home *** CD-ROM | disk | FTP | other *** search
/ BBS Toolkit / BBS Toolkit.iso / windows / autocs10.zip / AUTOCIS.WAS < prev    next >
Text File  |  1992-11-04  |  91KB  |  3,015 lines

  1. ;AUTOCIS.WAS - automated CIS script for Prowin
  2. ; Reduced capability script, awaiting compiler improvement
  3.  
  4. ; ****************************************************************************
  5. ; *  This is a script for Procomm for Windows that automates the uploadind   *
  6. ; *  and downloading of Mail, Forum messages and Library files.  Activities  *
  7. ; *  in other areas of CompuServe are also automated.  Task definition and   *
  8. ; *  message/letter writing and review is accomplished off-line without CIS  *
  9. ; *  charges and on-line operation is totally automated.                     *
  10. ; ****************************************************************************
  11.  
  12. ;                   Last update  2 November 1992
  13.  
  14. #define Forum1 "P&ractice"             ; menu descriptions
  15. #define Forum2 "&DataStorm"
  16. #define Forum3 "&PPI Forum"
  17. #define Forum4 "&Compaq Forum"
  18. #define Forum5 "&MECA"
  19. #define Forum6 "&Norton Utilities"
  20. #define Forum7 "&IBM Communications"
  21.  
  22. #define ForCmd1 "PRACTICE"            ; GO command for Forum
  23. #define ForCmd2 "DSTORM"
  24. #define ForCmd3 "PPIFORUM"
  25. #define ForCmd4 "CPQFORUM"
  26. #define ForCmd5 "MECA"
  27. #define ForCmd6 "NORUTL"
  28. #define ForCmd7 "IBMCOM"
  29.  
  30. ;                    LOCAL STRING VARIABLES used = 3
  31. ;                    GLOBAL STRING VARIABLES - 92 used
  32.  
  33. string Order, Order1, Order2, Order3, Order4, Order5
  34. string Cfg1,Cfg2,Cfg3,Cfg4,Cfg5,Cfg6,Cfg7,Cfg8,Cfg9,Cfg10,Cfg0="#############"
  35. string MailDir,FileDir,LogDir,LogName,LogLoc,TempS,WordS,Join,SaveS,Char
  36. string Dirname,UseFile,Name,ToDay,Month,Day,UserFor,DesFile,ETime
  37. string Mailin, MailOut, MesgIn, MesgOut, FileIn, FileOut, Title, CISTitle
  38. String Locn1,Locn2,Locn3,Locn4,Locn5
  39. String Area1,Area2,Area3,Area4,Area5
  40. String Sect1,Sect2,Sect3,Sect4,Sect5
  41. String Actn1,Actn2,Actn3,Actn4,Actn5
  42. String Extn1,Extn2,Extn3,Extn4,Extn5
  43. String ShoTask1,ShoTask2,ShoTask3,ShoTask4,ShoTask5
  44. String File1,File2,File3,File4,File5,File6,File7,File8,File9,File10,FileList
  45. String Var1,Var2,Var3,Var4,Var5,Var6        ; extra terms needed in listing
  46.  
  47. ;                   LOCAL NUMERICAL VARIABLES used = 7 (2 are Long)
  48. ;                   GLOBAL NUMERICAL VARIABLES - 39 used
  49. integer Pick, Choice, Done, GoAhead, Count, KeepOn, Flag, Item, BinCnt
  50. integer MailRecd, MailSent, MesgRecd, MesgSent, FileRecd, FileSent, MailWait
  51. integer Cfg11, Cfg12, Cfg13, Cfg14, Cfg15, Cfg16
  52. integer Tour, TourMax
  53. ;integer Var, Num, Len, Temp
  54. ;        ^I6  ^I7  ^I8  ^I9
  55. ;integer MultiTask,Task1,Task2,Task3,Task4,Task5
  56. ;          ^I0     ^I1   ^I2   ^I3   ^I4   ^I5
  57. ;Long STime ==> L1
  58.  
  59. ; =========================  Beginning of Script  ============================
  60.  
  61. PROC Main
  62. integer newmenu, menu1, menu2, menu3, menu5, menu6
  63.    isfile "AUTOCIS.CFG"
  64.    if success
  65.       Call ReadCfg
  66.       MailDir=Cfg8                     ; define directories
  67.       FileDir=Cfg9
  68.       LogDir=Cfg10
  69.    else
  70.       sdlgmsgbox "Initial Program Startup" "Personal User information needed" STOP OK choice BEEP
  71.       Cfg11=1,Cfg12=0,Cfg13=1,Cfg14=0,Cfg15=1,Cfg16=0 ; defaults for CfgOptions
  72.       Call PerConfig
  73.       Call DirConfig
  74.       Call SaveCfg
  75.    endif
  76.    if $FROMDDIR
  77.       Call LogOn
  78.       Call ExitWait
  79.       goto MainEnd
  80.    endif
  81.    if eq Cfg11 1
  82.       Call ProgInfo
  83.    endif
  84.    getwintext $ACTIVEWIN Title
  85.    CISTitle="Running AUTOCIS script within PROCOMM PLUS for Windows"
  86.    pwtitlebar CISTitle
  87.  
  88.    menubar newmenu
  89.    menupopup newmenu "&Mail" menu1
  90.       menuitem menu1 1 "Send &Composed Mail"
  91.       menuitem menu1 2 "Send Mail &File"
  92.       menuitem menu1 3 "&Receive Mail"
  93.       menuitem menu1 4 "&Write/Edit Letter"
  94.       menuitem menu1 5 "&View/Edit Capture"
  95.  
  96.    menupopup newmenu "&Forums" menu2
  97.       menuitem menu2 6 Forum1
  98.       menuitem menu2 7 Forum2
  99.       menuitem menu2 8 Forum3
  100.       menuitem menu2 9 Forum4
  101.       menuitem menu2 10 Forum5
  102.       menuitem menu2 11 Forum6
  103.       menuitem menu2 12 Forum7
  104.       menuitem menu2 13 "&User Specified"
  105.  
  106.    menupopup newmenu "&Ziff Net" menu3
  107.       menuitem menu3 14 "&After Hours"
  108.       menuitem menu3 15 "&Editorial"
  109.       menuitem menu3 16 "&Programming"
  110.       menuitem menu3 17 "&Utilities"
  111.       menuitem menu3 18 "Public &Brand"
  112.       menuitem menu3 19 "&SoftLib Files"
  113.  
  114.    menupopup newmenu "&Setup" menu5
  115.       menuitem menu5 25 "&User Info"
  116.       menuitem menu5 26 "&Directory Info"
  117.       menuitem menu5 27 "&Options"
  118.       menuitem menu5 28 "&Save Setup"
  119.       menuitem menu5 29 "&Program Data"
  120.  
  121.    menupopup newmenu "&Other" menu6
  122.       menuitem menu6 30 "&Multiple Tasks"
  123.       menuitem menu6 31 "&Restart dialing"
  124.       menuitem menu6 32 "E&xit program"
  125.  
  126.    showmenu newmenu
  127.    if eq Cfg11 1
  128.       UserMsg "> Select Topic from top menu bar`r\
  129.           (Mail   Forum   Ziff Net .....)`r`r\
  130. > Choose area from drop down menu`r`r\
  131. > Dialog box will be displayed if needed`r`r\
  132. > Choose Activity from dialog box`r`r\
  133. { Turn off Option 1 to remove this display }"
  134.    endif
  135.    when menu call Controller
  136.    while 1
  137.    endwhile
  138. MainEnd:
  139. ENDPROC ;Main
  140.  
  141. PROC Controller
  142. integer status=$MENU
  143.  
  144.    clearwhen menu
  145.    switch status
  146.       case 1
  147.          Order="Mail"
  148.          Order1="GO CIS:MAIL"
  149.          Order2=$NULLSTR
  150.          Order3="Send Text"
  151.          GoAhead=1
  152.          Call Initiate
  153.       endcase
  154.       case 2
  155.          Order="Mail"
  156.          Order1="GO CIS:MAIL"
  157.          Order2=$NULLSTR
  158.          Order3="UPL"
  159.          Call Filename
  160.          Order3="Send File"
  161.          if Done=1
  162.             Call Initiate
  163.          endif
  164.       endcase
  165.       case 3
  166.          Order="Mail"
  167.          Order1="GO CIS:MAIL"
  168.          Order2=$NULLSTR
  169.          Order3="Get Mail"
  170.          GoAhead=1
  171.          Call Initiate
  172.       endcase
  173.       case 4
  174.          DirName=MailDir
  175.          UseFile="LETTERS.OUT"
  176.          Call DoEdit
  177.       endcase
  178.       case 5
  179.          DirName=LogDir
  180.          Call DefineLog
  181.          UseFile=LogName
  182.          Call DoEdit
  183.       endcase
  184.       case 6
  185.          Order="Forum"
  186.          Order1="GO CIS:"
  187.          strcat Order1 ForCmd1
  188.          Call Forum
  189.          Call Initiate
  190.       endcase
  191.       case 7
  192.          Order="Forum"
  193.          Order1="GO CIS:"
  194.          strcat Order1 ForCmd2
  195.          Call Forum
  196.          Call Initiate
  197.       endcase
  198.       case 8
  199.          Order="Forum"
  200.          Order1="GO CIS:"
  201.          strcat Order1 ForCmd3
  202.          Call Forum
  203.          Call Initiate
  204.       endcase
  205.       case 9
  206.          Order="Forum"
  207.          Order1="GO CIS:"
  208.          strcat Order1 ForCmd4
  209.          Call Forum
  210.          Call Initiate
  211.       endcase
  212.       case 10
  213.          Order="Forum"
  214.          Order1="GO CIS:"
  215.          strcat Order1 ForCmd5
  216.          Call Forum
  217.          Call Initiate
  218.       endcase
  219.       case 11
  220.          Order="Forum"
  221.          Order1="GO CIS:"
  222.          strcat Order1 ForCmd6
  223.          Call Forum
  224.          Call Initiate
  225.       endcase
  226.       case 12
  227.          Order="Forum"
  228.          Order1="GO CIS:"
  229.          strcat Order1 ForCmd7
  230.          Call Forum
  231.          Call Initiate
  232.       endcase
  233.       case 13
  234.          sdlginput "USER SPECIFIED FORUM" "Enter name of desired Forum" UserFor
  235.          Order1="GO CIS:"
  236.          strcat Order1 UserFor
  237.          Order="Forum"
  238.          Call Forum
  239.          Call Initiate
  240.       endcase
  241.       case 14
  242.          Order="Forum"
  243.          Order1="GO ZNT:AFTERHOURS"
  244.          Call Forum
  245.          Call Initiate
  246.       endcase
  247.       case 15
  248.          Order="Forum"
  249.          Order1="GO ZNT:EDITORIAL"
  250.          Call Forum
  251.          Call Initiate
  252.       endcase
  253.       case 16
  254.          Order="Forum"
  255.          Order1="GO ZNT:PROGRAM"
  256.          Call Forum
  257.          Call Initiate
  258.       endcase
  259.       case 17
  260.          Order="Forum"
  261.          Order1="GO ZNT:UTILFORUM"
  262.          Call Forum
  263.          Call Initiate
  264.       endcase
  265.       case 18
  266.          Order="Forum"
  267.          Order1="GO ZNT:PBS"
  268.          Call Forum
  269.          Call Initiate
  270.       endcase
  271.       case 19
  272.          Order="SoftLib"
  273.          Order1="GO ZNT:SOFTLIB"
  274.          Call SoftDef
  275.          Call Initiate
  276.       endcase
  277.       case 25
  278.          Call PerConfig
  279.       endcase
  280.       case 26
  281.          Call DirConfig
  282.       endcase
  283.       case 27
  284.          Call OptConfig
  285.       endcase
  286.       case 28
  287.          Call SaveCfg
  288.       endcase
  289.       case 29
  290.          Call ProgInfo
  291.       endcase
  292.       case 30
  293.          Call ClearTask
  294.          I0=1
  295.          Call Initiate
  296.       endcase
  297.       case 31
  298.          GoAhead=1
  299.          Call Initiate
  300.       endcase
  301.       case 32                          ; if EXIT was selected
  302.          sdlgmsgbox "AutoCIS Script Program" "Do you want to exit the AutoCIS Script?"\
  303.           QUESTION YESNO I7 BEEP
  304.          switch I7
  305.             case 6                     ; this is yes
  306.                Title="PROCOMM PLUS for Windows"
  307.                pwtitlebar Title
  308.                halt
  309.             endcase
  310.             case 7                     ; this is no
  311.                pwtitlebar CISTitle
  312.                exitswitch
  313.             endcase
  314.          endswitch
  315.       endcase
  316.    endswitch
  317.    when menu call Controller
  318.  
  319. ENDPROC ;Controller
  320.  
  321. PROC Initiate
  322.    if eq I0 1                   ; indicates to store in Multi Task
  323.       Call Multi
  324.    endif
  325.    if eq GoAhead 0
  326.       goto InitiateOut                 ; go back for next task if MultiTasking
  327.    endif
  328.    if eq Cfg13 1
  329.       sdlgmsgbox "CALL INITIATION" "Continue to place call ?" QUESTION OKCANCEL I7 2 BEEP
  330.    endif
  331.    switch I7
  332.       case 1
  333.          if eq Tour 0
  334.             Call LogOn
  335.             if eq KeepOn 1                     ; if still connected
  336.                transmit Order1                 ; transmit specified destination
  337.                transmit "^M"
  338.             else
  339.                pwtitlebar CISTitle
  340.                goto InitiateOut                ; in case connection was lost
  341.             endif
  342.             Call PickArea
  343.             strcmp Order3 "Manual mode"        ; if this is Manual mode
  344.             if not success                     ;   logging off has been performed
  345.                Call LogOff
  346.             endif
  347.          else
  348.             Call OnTour
  349.          endif
  350.          pwtitlebar CISTitle
  351.          Call Summary
  352.       endcase
  353.       case 2
  354.          Order1=$NULLSTR
  355.          Order2=$NULLSTR
  356.          Order3=$NULLSTR
  357.          Order4=$NULLSTR
  358.          Order5=$NULLSTR
  359.          Join=$NULLSTR
  360.       endcase
  361.    endswitch
  362. InitiateOut:
  363.    GoAhead=0
  364. ENDPROC ;Initiate
  365.  
  366. PROC PickArea
  367.    switch Order
  368.       case "Mail"
  369.          Call MailRun                  ; on line Mail procedures
  370.       endcase
  371.       case "Forum"
  372.          Call ForumRun                 ; on line Forum procedures
  373.       endcase
  374.       case "SoftLib"
  375.          Call SoftRun                  ; on line Ziff Net SoftLib procedures
  376.       endcase
  377.    endswitch
  378. ENDPROC ;PickArea
  379.  
  380. PROC OnTour
  381.    Tour = 0
  382.    Order1=$NULLSTR
  383. StartTask:
  384.    inc Tour
  385.    TempS=Order1                        ; save previous Order1
  386.    switch Tour
  387.       case 1
  388.          Order=Locn1
  389.          Order1="GO "
  390.          strcat Order1 Area1
  391.          strupr Order1
  392.          Order2=Sect1
  393.          strupr Order2
  394.          Order3=Actn1
  395.          strupr Order3
  396.          Order4=Extn1
  397.       endcase
  398.       case 2
  399.          Order=Locn2
  400.          Order1="GO "
  401.          strcat Order1 Area2
  402.          strupr Order1
  403.          Order2=Sect2
  404.          strupr Order2
  405.          Order3=Actn2
  406.          strupr Order3
  407.          Order4=Extn2
  408.       endcase
  409.       case 3
  410.          Order=Locn3
  411.          Order1="GO "
  412.          strcat Order1 Area3
  413.          strupr Order1
  414.          Order2=Sect3
  415.          strupr Order2
  416.          Order3=Actn3
  417.          strupr Order3
  418.          Order4=Extn3
  419.       endcase
  420.       case 4
  421.          Order=Locn4
  422.          Order1="GO "
  423.          strcat Order1 Area4
  424.          strupr Order1
  425.          Order2=Sect4
  426.          strupr Order2
  427.          Order3=Actn4
  428.          strupr Order3
  429.          Order4=Extn4
  430.       endcase
  431.       case 5
  432.          Order=Locn5
  433.          Order1="GO "
  434.          strcat Order1 Area5
  435.          strupr Order1
  436.          Order2=Sect5
  437.          strupr Order2
  438.          Order3=Actn5
  439.          strupr Order3
  440.          Order4=Extn5
  441.       endcase
  442.    endswitch
  443.    if eq Tour 1                        ; if first multi task
  444.       Call LogOn
  445.       if eq KeepOn 1                   ; if not connected
  446.          transmit Order1               ; transmit specified destination
  447.          transmit "^M"
  448.       else
  449.          pwtitlebar CISTitle
  450.          goto TourOut                  ; in case connection was lost
  451.       endif
  452.    else                                ; if second or later multi task
  453.       strcmp TempS Order1              ; is this Order1 the same as the last ?
  454.       if success                       ; if staying in Forum
  455.          transmit "B^M"                ;     back up to top menu
  456.          waitfor "!" 3
  457.       else                             ; if new area is specified
  458.          transmit "EXIT^M"             ; exit forum - this stops command mode
  459.          waitfor "Enter choice" 10
  460.          transmit "T^M"                ; request CIS top menu
  461.          waitfor "Enter choice" 10
  462.          transmit Order1               ; send GO command for new area
  463.          transmit "^M"
  464.       endif
  465.    endif
  466. ; continue as if this is a single activity session
  467.    Call PickArea                       ; select where to go (Mail,Forum,Other)
  468. ; return here from Forum, Mail or Assist
  469.    if eq Tour TourMax
  470.       strcmp Order3 "Manual mode"      ; if this is Manual mode
  471.       if not success                   ;        logging off has been performed
  472.          Call LogOff
  473.       endif
  474.    else
  475.       goto StartTask                   ; go to perform next Task
  476.    endif
  477.    Tour=0
  478.    TourMax=0
  479. TourOut:
  480. ENDPROC ;OnTour
  481.  
  482. PROC Summary
  483.    ITOA MailRecd MailIn
  484.    ITOA MailSent MailOut
  485.    ITOA MesgRecd MesgIn
  486.    ITOA MesgSent MesgOut
  487.    ITOA FileRecd FileIn
  488.    ITOA FileSent FileOut
  489.    dialogbox 120 90 125 115 2 "CIS ACTIVITY SUMMARY"
  490.       pushbutton 44 90 40 14 "Proceed" normal
  491.       text  25 10 62 9 left "Letters Received :"
  492.       text  25 20 62 9 left "Letters  Sent       :"
  493.       text  25 35 62 9 left "Messages Rec'd  :"
  494.       text  25 45 62 9 left "Messages Sent    :"
  495.       text  25 60 62 9 left "Files DnLoaded   :"
  496.       text  25 70 62 9 left "Files UpLoaded   :"
  497.       vtext 90 10 20 9 left Mailin
  498.       vtext 90 20 20 9 left Mailout
  499.       vtext 90 35 20 9 left MesgIn
  500.       vtext 90 45 20 9 left MesgOut
  501.       vtext 90 60 20 9 left FileIn
  502.       vtext 90 70 20 9 left FileOut
  503.    enddialog
  504.    while not $DIALOG
  505.    endwhile
  506.    MailIn=$NULLSTR
  507.    MailOut=$NULLSTR
  508.    MesgIn=$NULLSTR
  509.    MesgOut=$NULLSTR
  510.    FileIn=$NULLSTR
  511.    FileOut=$NULLSTR
  512.    MailRecd=0
  513.    MailSent=0
  514.    MesgRecd=0
  515.    MesgSent=0
  516.    FileRecd=0
  517.    FileSent=0
  518. ENDPROC ;Summary
  519.  
  520. PROC ShoBox
  521.    dialogbox 120 50 120 150 2 "SELECTIONS"
  522.       groupbox 10 15 100 105 shadow
  523.       radiobutton 15 160 8 8 "" Pick
  524.       radiobutton 15 25 8 8 ""
  525.       radiobutton 15 35 8 8 ""
  526.       radiobutton 15 45 8 8 ""
  527.       radiobutton 15 55 8 8 ""
  528.       radiobutton 15 65 8 8 ""
  529.       radiobutton 15 75 8 8 ""
  530.       radiobutton 15 85 8 8 ""
  531.       radiobutton 15 95 8 8 ""
  532.       radiobutton 15 105 8 8 "" endgroup
  533.       pushbutton 10 130 45 15 "Proceed" normal default
  534.       pushbutton 65 130 45 15 "Cancel" normal
  535.       vtext 5 5 78 10 left S1
  536.       vtext 25 25 80 8 left S2
  537.       vtext 25 35 80 8 left S3
  538.       vtext 25 45 80 8 left S4
  539.       vtext 25 55 80 8 left S5
  540.       vtext 25 65 80 8 left S6
  541.       vtext 25 75 80 8 left S7
  542.       vtext 25 85 80 8 left S8
  543.       vtext 25 95 80 8 left S9
  544.       vtext 25 105 80 8 left S0
  545.    enddialog
  546. ENDPROC ;ShoBox
  547.  
  548. ;  -------------------------------------------
  549. ; |     DEFINITION  OF  FORUM  ACTIVITIES     |
  550. ;  -------------------------------------------
  551.  
  552. PROC Forum
  553.    Call JoinForum
  554.    Call SectionBox
  555.    choice=$DIALOG
  556.    while choice != 1
  557.       choice=$DIALOG
  558.       switch choice
  559.          case 10                       ; accept inputs & exit
  560.             Done=1
  561.             GoAhead=1
  562.             exitwhile
  563.          endcase
  564.          case 11                       ; cancel & exit
  565.             Order1=$NULLSTR
  566.             Order2=$NULLSTR
  567.             Order3=$NULLSTR
  568.             Order4=$NULLSTR
  569.             GoAhead=0
  570.             exitwhile
  571.          endcase
  572.          case 50
  573.             switch Pick
  574.                case 1
  575.                endcase
  576.                case 2
  577.                   Order2="INSTRUCTIONS"
  578.                   Order3="Manual mode"
  579.                   usermsg "Requires User supplied commands"
  580.                endcase
  581.                case 3
  582.                   Order2="MESSAGES"
  583.                   Call ShoMes
  584.                   if eq Done 1
  585.                      exitwhile
  586.                   endif
  587.                   Pick=3
  588.                   Call SectionBox
  589.                endcase
  590.                case 4
  591.                   Order2="LIBRARIES"
  592.                   Call ShoLib
  593.                   if eq Done 1
  594.                      exitwhile
  595.                   endif
  596.                   Pick=3
  597.                   Call SectionBox
  598.                endcase
  599.                case 5
  600.                   Order2="CONFERENCE"
  601.                   Order3="Manual mode"
  602.                   usermsg "Requires User supplied commands"
  603.                endcase
  604.                case 6
  605.                   Order2="ANNOUNCE"
  606.                   Order3="Manual mode"
  607.                   usermsg "Requires User supplied commands"
  608.                endcase
  609.                case 7
  610.                   Order2="DIRECTORY"
  611.                   Order3="Manual mode"
  612.                   usermsg "Requires User supplied commands"
  613.                endcase
  614.                case 8
  615.                   Order2="OPTIONS"
  616.                   Order3="Manual mode"
  617.                   usermsg "Requires User supplied commands"
  618.                endcase
  619.                case 9
  620.                   Call ShoList
  621.                   Call SectionBox
  622.                endcase
  623.                case 10
  624.                   DirName=LogDir
  625.                   UseFile="MESSAGES."
  626.                   substr TempS Order1 7 3
  627.                   strcat UseFile TempS
  628.                   Call DoEdit
  629.                   Call SectionBox
  630.                endcase
  631.             endswitch
  632.          endcase
  633.       endswitch
  634.    endwhile
  635. ENDPROC ;Forum
  636.  
  637. PROC SectionBox
  638.    Pick=1
  639.    S1="FORUM SECTIONS"
  640.    S2="Instructions"
  641.    S3="Messages"
  642.    S4="Libraries"
  643.    S5="Conference"
  644.    S6="Announcements"
  645.    S7="Member Directory"
  646.    S8="Options of Forum"
  647.    S9="Section/Library List"
  648.    S0="Write/Edit message(s)"
  649.    Call ShoBox
  650. ENDPROC ;SectionBox
  651.  
  652. PROC ShoMes
  653.    Pick=1
  654.    S1="MESSAGE ACTIVITIES"
  655.    S2="Send message(s)"
  656.    S3="Read New"
  657.    S4="Read To"
  658.    S5="Read From"
  659.    S6="Read Thread"
  660.    S7="Find Root"
  661.    S8="Read Starting"
  662.    S9="Read Days"
  663.    S0="Delete message"
  664.    Call ShoBox
  665.    choice=$DIALOG
  666.    while choice != 1
  667.       choice=$DIALOG
  668.       switch choice
  669.          case 10                       ; accept inputs & exit
  670.             Done=1
  671.             GoAhead=1
  672.             exitwhile
  673.          endcase
  674.          case 11                       ; cancel & exit
  675.             Done=1
  676.             Order1=$NULLSTR
  677.             Order2=$NULLSTR
  678.             Order3=$NULLSTR
  679.             Order4=$NULLSTR
  680.             GoAhead=0
  681.             Pick=1
  682.             exitwhile
  683.          endcase
  684.          case 50
  685.             switch Pick
  686.                case 1
  687.                endcase
  688.                case 2
  689.                   Order3="Send Mesg"
  690.                   Order4=$NULLSTR
  691.                endcase
  692.                case 3
  693.                   Order3="REA NEW"
  694.                   Order4=$NULLSTR
  695.                endcase
  696.                case 4
  697.                   Order3="REA ALL TO:"
  698.                   sdlginput "INPUT REQUEST" "Enter User ID number" Order4
  699.                endcase
  700.                case 5
  701.                   Order3="REA ALL FRO "
  702.                   sdlginput "INPUT REQUEST" "Enter User ID number" Order4
  703.                endcase
  704.                case 6
  705.                   Order3="REA THR NUM:"
  706.                   sdlginput "INPUT REQUEST" "Enter message number" Order4
  707.                endcase
  708.                case 7
  709.                   Order3="ROO:"
  710.                   sdlginput "INPUT REQUEST" "Enter message number" Order4
  711.                endcase
  712.                case 8
  713.                   Order3="REA STA:"
  714.                   sdlginput "INPUT REQUEST" "Enter message number" Order4
  715.                endcase
  716.                case 9
  717.                   Order3="REA DAY:"
  718.                   sdlginput "INPUT REQUEST" "Enter number of days" Order4
  719.                endcase
  720.                case 10
  721.                   Order3="DEL:"
  722.                   sdlginput "INPUT REQUEST" "Enter message number" Order4
  723.                endcase
  724.             endswitch
  725.          endcase
  726.       endswitch
  727.    endwhile
  728. ENDPROC ;ShoMes
  729.  
  730. PROC ShoLib
  731.    Pick=1
  732.    Call LibBox
  733.    choice=$DIALOG
  734.    while choice != 1
  735.       choice=$DIALOG
  736.       switch choice
  737.          case 10                       ; accept inputs & exit
  738.             Done=1
  739.             GoAhead=1
  740.             exitwhile
  741.          endcase
  742.          case 11                       ; cancel & exit
  743.             Done=0
  744.             GoAhead=0
  745.             Order1=$NULLSTR
  746.             Order2=$NULLSTR
  747.             Order3=$NULLSTR
  748.             Order4=$NULLSTR
  749.             exitwhile
  750.          endcase
  751.          case 50
  752.             switch Pick
  753.                case 1
  754.                endcase
  755.                case 2
  756.                   Order3="Manual mode"
  757.                   Order4=$NULLSTR
  758.                   usermsg "Requires User supplied commands"
  759.                endcase
  760.                case 3                            ; this is browse of library
  761.                   Order3="BRO LIB:"
  762.                   sdlginput "INPUT REQUEST" "Enter Library number(s)" TempS
  763.                   strcat Order3 TempS
  764.                   Order4=$NULLSTR
  765.                   usermsg "Requires User supplied commands"
  766.                endcase
  767.                case 4                            ; this is count of files
  768.                   Order3="COU LIB:"
  769.                   sdlginput "INPUT REQUEST" "Enter Library number(s)" TempS
  770.                   strcat Order3 TempS
  771.                   Order4=$NULLSTR
  772.                endcase
  773.                case 5                            ; this is short directory
  774.                   Order3="LIST COU"
  775.                   sdlginput "INPUT REQUEST" "Enter Number of day(s)" TempS
  776.                   strcmp TempS $NULLSTR
  777.                   if failure
  778.                      strcat Order3 " AGE:"
  779.                      strcat Order3 TempS
  780.                   endif
  781.                   Order4=" LIB:"
  782.                   sdlginput "INPUT REQUEST" "Enter Library number(s)" TempS
  783.                   strcat Order4 TempS
  784.                endcase
  785.                case 6                            ; this is descriptive directory
  786.                   Order3="SCA DES"
  787.                   sdlginput "INPUT REQUEST" "Enter Number of day(s)" TempS
  788.                   strcmp TempS $NULLSTR
  789.                   if failure
  790.                      strcat Order3 " AGE:"
  791.                      strcat Order3 TempS
  792.                   endif
  793.                   Order4=" LIB:"
  794.                   sdlginput "INPUT REQUEST" "Enter Library number(s)" TempS
  795.                   strcat Order4 TempS
  796.                   sdlginput "INPUT REQUEST" "Enter Keywords for listing" TempS
  797.                   strcmp TempS $NULLSTR
  798.                   if failure
  799.                      strcat Order4 " KEY:"
  800.                      strcat Order4 TempS
  801.                   endif
  802.                endcase
  803.                case 7
  804.                   Order3="UPL"
  805.                   Call Filename
  806.                   Call LibBox
  807.                endcase
  808.                case 8
  809.                   Order3="DOW"
  810.                   Call Filename
  811.                   Call LibBox
  812.                endcase
  813.                case 9
  814.                   Order3="ERA"
  815.                   Call Filename
  816.                   Call LibBox
  817.                endcase
  818.                case 10
  819.                endcase
  820.             endswitch
  821.          endcase
  822.       endswitch
  823.    endwhile
  824. ENDPROC ;ShoLib
  825.  
  826. PROC ShoList
  827.    Call GetList
  828.    dialogbox 80 20 200 200 2 "SECTION DESCRIPTIONS"
  829.       text  15 4 116 8 left "Message Section List"
  830.       text  15 14 116 4 left "~~~~~~~~~~~~~~~"
  831.       text  115 4 116 8 left "Library Section List"
  832.       text  115 14 116 4 left "~~~~~~~~~~~~~~"
  833.       vtext 12 20 185 8 left S1
  834.       vtext 12 30 185 8 left S2
  835.       vtext 12 40 185 8 left S3
  836.       vtext 12 50 185 8 left S4
  837.       vtext 12 60 185 8 left S5
  838.       vtext 12 70 185 8 left S6
  839.       vtext 12 80 185 8 left S7
  840.       vtext 12 90 185 8 left S8
  841.       vtext 12 100 185 8 left S9
  842.       vtext 12 110 185 8 left S0
  843.       vtext 12 120 185 8 left var1
  844.       vtext 12 130 185 8 left var2
  845.       vtext 12 140 185 8 left var3
  846.       vtext 12 150 185 8 left var4
  847.       vtext 12 160 185 8 left var5
  848.       vtext 12 170 185 8 left var6
  849.       pushbutton 75 180 50 15 "Finished" normal default
  850.    enddialog
  851.    choice=$DIALOG
  852.    while choice != 1
  853.       choice=$DIALOG
  854.       if eq choice 10
  855.          exitwhile
  856.       endif
  857.    endwhile
  858. ENDPROC  ;ShoList
  859.  
  860. #INCLUDE "AUTOCIS.INC"
  861.  
  862. PROC LibBox
  863.    S1="LIBRARY ACTIVITIES"
  864.    S2="Manual mode"
  865.    S3="Browse"
  866.    S4="File Count"
  867.    S5="Short Directory"
  868.    S6="Descriptive Directory"
  869.    S7="Upload File(s)"
  870.    S8="Download File(s)"
  871.    S9="Remove File"
  872.    S0=""
  873.    Call ShoBox
  874. ENDPROC ;LibBox
  875.  
  876. PROC JoinForum
  877.     strlen Order1 I8
  878.     sub I8 7 I6
  879.     substr WordS Order1 7 I6          ; WordS is Area name (i.e. DSTORM)
  880.     isfile "AUTOCIS.LST"
  881.     if success
  882.        fopen 0 "AUTOCIS.LST" READ TEXT
  883.        while not FEOF 0
  884.           Fgets 0 TempS
  885.           strfind TempS WordS
  886.           if found
  887.              fclose 0
  888.              goto JoinOut
  889.           endif
  890.        endwhile
  891.        fclose 0
  892.     else
  893.        fopen 0 "AUTOCIS.LST" CREATE TEXT
  894.        fclose 0
  895.     endif
  896.     sdlgmsgbox "FORUM MEMBERSHIP STATUS" "You are presently not a member of this Forum !\
  897.             * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * \
  898.             Do you wish to JOIN the Forum at this time ?" STOP YESNO I7 BEEP
  899.     switch I7
  900.        case 6                          ; this is yes
  901.           Join=WordS                   ; Join is Area name
  902.           fopen 0 "AUTOCIS.LST" WRITE TEXT
  903.           fseek 0 0 2                  ; move pointer to just before EOF marker
  904.           strlen WordS I8
  905.           fwrite 0 WordS I8
  906.           fputc 0 10
  907.           fclose 0
  908.        endcase
  909.        case 7                          ; this is no
  910.           goto JoinOut
  911.        endcase
  912.     endswitch
  913. JoinOut:
  914. ENDPROC ;JoinForum
  915.  
  916. ;  --------------------------------------------------
  917. ; |     DEFINITION  OF  ZIFF SOFTLIB  ACTIVITIES     |
  918. ;  --------------------------------------------------
  919.  
  920. PROC SoftDef
  921.    Pick=1
  922.    Call SoftBox
  923.    choice=$DIALOG
  924.    while choice != 1
  925.       choice=$DIALOG
  926.       switch choice
  927.          case 10                       ; accept inputs & exit
  928.             Done=1
  929.             GoAhead=1
  930.             exitwhile
  931.          endcase
  932.          case 11                       ; cancel & exit
  933.             Done=0
  934.             GoAhead=0
  935.             Order1=$NULLSTR
  936.             Order2=$NULLSTR
  937.             Order3=$NULLSTR
  938.             Order4=$NULLSTR
  939.             exitwhile
  940.          endcase
  941.          case 50
  942.             switch Pick
  943.                case 1
  944.                endcase
  945.                case 2                            ; download latest files
  946.                   Order2="1"
  947.                   Order3="Manual mode"
  948.                   Order4=$NULLSTR
  949.                   usermsg "Requires User supplied commands"
  950.                endcase
  951.                case 3                            ; Essential software kits
  952.                   Order2="2"
  953.                   Order3="Manual mode"
  954.                   Order4=$NULLSTR
  955.                   usermsg "Requires User supplied commands"
  956.                endcase
  957.                case 4                            ; search for a utility
  958.                   Order2="3"
  959.                   Call SoftSearch
  960.                   if eq Done 1
  961.                      exitwhile
  962.                   endif
  963.                   Pick=4
  964.                   Call SoftBox
  965.                endcase
  966.                case 5                            ; download a utility
  967.                   Order2="4"
  968.                   Order3="DOW"
  969.                   Call FileName
  970.                   if eq Done 1
  971.                      exitwhile
  972.                   endif
  973.                   Pick=5
  974.                   Call SoftBox
  975.                endcase
  976.                case 6                            ; download a PCM utility
  977.                   Order2="7"
  978.                   Order3="Manual mode"
  979.                endcase
  980.                case 7                            ; about the Library
  981.                   Order2="10"
  982.                endcase
  983.                case 8                            ; search instructions
  984.                   Order2="11"
  985.                endcase
  986.                case 9                            ; uploading submissions
  987.                   Order2="12"
  988.                   Order3="Manual mode"
  989.                endcase
  990.                case 10
  991.                endcase
  992.             endswitch
  993.          endcase
  994.       endswitch
  995.    endwhile
  996. ENDPROC  ;SoftDef
  997.  
  998. PROC SoftBox
  999.    S1="SOFTLIB ACTIVITIES"
  1000.    S2="Download Latest Files"
  1001.    S3="Essential Software Kits"
  1002.    S4="Search for a Utility"
  1003.    S5="Download a Utility"
  1004.    S6="About the Library"
  1005.    S7="Search Instructions"
  1006.    S8="Uploading Submissions"
  1007.    S9=""
  1008.    S0=""
  1009.    Call ShoBox
  1010. ENDPROC ;SoftBox
  1011.  
  1012. PROC SoftSearch
  1013.    Pick=1
  1014.    Call SearchBox
  1015.    choice=$DIALOG
  1016.    while choice != 1
  1017.       choice=$DIALOG
  1018.       switch choice
  1019.          case 10                       ; accept inputs & exit
  1020.             Done=1
  1021.             GoAhead=1
  1022.             exitwhile
  1023.          endcase
  1024.          case 11                       ; cancel & exit
  1025.             Done=0
  1026.             GoAhead=0
  1027.             Order1=$NULLSTR
  1028.             Order2=$NULLSTR
  1029.             Order3=$NULLSTR
  1030.             Order4=$NULLSTR
  1031.             exitwhile
  1032.          endcase
  1033.          case 50
  1034.             switch Pick
  1035.                case 1
  1036.                endcase
  1037.                case 2                            ; number 1 type utility
  1038.                   Order3="1"
  1039.                   Order4="Manual mode"
  1040.                   Order5=$NULLSTR
  1041.                   usermsg "Requires User supplied commands"
  1042.                endcase
  1043.                case 3                            ; number 2 keyword
  1044.                   Order3="2"
  1045.                   sdlginput "INPUT REQUEST" "Enter Keyword:" Order4
  1046.                   Order5=$NULLSTR
  1047.                endcase
  1048.                case 4                            ; number 3 PC M files
  1049.                   Order3="3"
  1050.                   Order4="Manual mode"
  1051.                   Order5=$NULLSTR
  1052.                   usermsg "Requires User supplied commands"
  1053.                endcase
  1054.                case 5                            ; number 4 PC C files
  1055.                   Order3="4"
  1056.                   Order4="Manual mode"
  1057.                   Order5=$NULLSTR
  1058.                   usermsg "Requires User supplied commands"
  1059.                endcase
  1060.                case 6                            ; number 5 PC W files
  1061.                   Order3="5"
  1062.                   Order4="Manual mode"
  1063.                   Order5=$NULLSTR
  1064.                   usermsg "Requires User supplied commands"
  1065.                endcase
  1066.                case 7                            ; number 6 File name
  1067.                   Order3="6"
  1068.                   sdlginput "INPUT REQUEST" "Enter Filename:" Order4
  1069.                   Order5=$NULLSTR
  1070.                endcase
  1071.                case 8                            ; number 7 Date
  1072.                   Order3="7"
  1073.                   sdlginput "INPUT REQUEST" "Enter Release date:" Order4
  1074.                   Order5=$NULLSTR
  1075.                endcase
  1076.                case 9                            ; number 8 Author
  1077.                   Order3="8"
  1078.                   sdlginput "INPUT REQUEST" "Enter Author UID #:" Order4
  1079.                   Order5=$NULLSTR
  1080.                endcase
  1081.                case 10
  1082.                endcase
  1083.             endswitch
  1084.          endcase
  1085.       endswitch
  1086.    endwhile
  1087. ENDPROC  ;SoftSearch
  1088.  
  1089. PROC Searchbox
  1090.    S1="SEARCH TYPE"
  1091.    S2="Type of Utility"
  1092.    S3="Keyword"
  1093.    S4="PC Magazine Files"
  1094.    S5="PC Computing Files"
  1095.    S6="PC Week Files"
  1096.    S7="File Name"
  1097.    S8="Date"
  1098.    S9="Author"
  1099.    S0=""
  1100.    Call ShoBox
  1101. ENDPROC ;SoftBox
  1102.  
  1103. ;  --------------------------------------------------------------
  1104. ; |     DEFINITION  OF  FILENAMES  FOR  UPLOAD  OR  DOWNLOAD     |
  1105. ;  --------------------------------------------------------------
  1106.  
  1107. PROC Filename
  1108.    FileList=Cfg9                          ; this is file directory
  1109.    strcat FileList "\File"
  1110.    strcat FileList Order3
  1111.    strcat FileList "."
  1112.    substr Char Order1 7 3
  1113.    strcat FileList Char
  1114.    isfile FileList
  1115.    if success
  1116.       sdlgmsgbox "FILENAME LIST" "Over write existing list ?" QUESTION YESNO choice
  1117.       switch choice
  1118.          case 7                        ; this is no
  1119.             Done=1
  1120.             GoAhead=1
  1121.             goto FilenameOut
  1122.          endcase
  1123.       endswitch
  1124.    endif
  1125.    fopen 0 FileList CREATE TEXT
  1126.    Call ClrFilename
  1127.    Call FileBox
  1128.    choice=$DIALOG
  1129.    while choice != 1
  1130.       choice=$DIALOG
  1131.       switch choice
  1132.          case 10                          ; add a filename
  1133.             Call DefineFile
  1134.             Call FileBox
  1135.          endcase
  1136.          case 11                          ; clear data
  1137.             fclose 0
  1138.             fopen 0 FileList CREATE TEXT  ; this clears the file to no contents
  1139.             Call ClrFilename
  1140.             Call FileBox
  1141.          endcase
  1142.          case 12                          ; cancel
  1143.             fclose 0
  1144.             fopen 0 FileList CREATE TEXT  ; clear the file contents
  1145.             fclose 0
  1146.             Done=0
  1147.             GoAhead=0
  1148.             exitwhile
  1149.          endcase
  1150.          case 13                          ; finished
  1151.             fwrite 0 "END" 3
  1152.             fputc 0 10
  1153.             fputc 0 10
  1154.             fclose 0
  1155.             Done=1
  1156.             GoAhead=1
  1157.             exitwhile
  1158.          endcase
  1159.       endswitch
  1160.    endwhile
  1161. FilenameOut:
  1162. ENDPROC ;Filename
  1163.  
  1164. PROC FileBox
  1165.    dialogbox 90 70 195 145 2 "UPLOAD/DOWNLOAD FILENAME DEFINITION"
  1166.       text  25 5 20 8 left "Lib #"
  1167.       text  50 5 20 8 left "Type"
  1168.       text  90 5 30 8 left "Filename"
  1169.       text  140 5 50 8 left "Source User ID"
  1170.       text  5 20 8 8 right "1"
  1171.       text  5 30 8 8 right "2"
  1172.       text  5 40 8 8 right "3"
  1173.       text  5 50 8 8 right "4"
  1174.       text  5 60 8 8 right "5"
  1175.       text  5 70 8 8 right "6"
  1176.       text  5 80 8 8 right "7"
  1177.       text  5 90 8 8 right "8"
  1178.       text  5 100 8 8 right "9"
  1179.       text  5 110 8 8 right "10"
  1180.       vtext 28 20 165 8 left File1
  1181.       vtext 28 30 165 8 left File2
  1182.       vtext 28 40 165 8 left File3
  1183.       vtext 28 50 165 8 left File4
  1184.       vtext 28 60 165 8 left File5
  1185.       vtext 28 70 165 8 left File6
  1186.       vtext 28 80 165 8 left File7
  1187.       vtext 28 90 165 8 left File8
  1188.       vtext 28 100 165 8 left File9
  1189.       vtext 28 110 165 8 left File10
  1190.       pushbutton 6 125 40 15 "Add File" normal
  1191.       pushbutton 54 125 40 15 "Clear Data" normal
  1192.       pushbutton 102 125 40 15 "Cancel" normal
  1193.       pushbutton 150 125 40 15 "Proceed" normal
  1194.    enddialog
  1195. ENDPROC ;FileBox
  1196.  
  1197. PROC ClrFilename
  1198.    File1=$NULLSTR
  1199.    File2=$NULLSTR
  1200.    File3=$NULLSTR
  1201.    File4=$NULLSTR
  1202.    File5=$NULLSTR
  1203.    File6=$NULLSTR
  1204.    File7=$NULLSTR
  1205.    File8=$NULLSTR
  1206.    File9=$NULLSTR
  1207.    File10=$NULLSTR
  1208. ENDPROC ;ClrFilename
  1209.  
  1210. PROC DefineFile
  1211.    strcmp Order1 "GO CIS:MAIL"
  1212.    if success
  1213.       WordS="           "
  1214.       goto SkipLib
  1215.    endif
  1216.    strcmp Order1 "GO ZNT:SOFTLIB"
  1217.    if success
  1218.       WordS="           "
  1219.       goto SkipLib
  1220.    endif
  1221.    sdlginput "LIBRARY DEFINITION" "Enter Library:" TempS
  1222.    strlen TempS I8
  1223.    if I8 != 2
  1224.       WordS="  "
  1225.       strcat WordS TempS
  1226.    else
  1227.       WordS=TempS
  1228.    endif
  1229.    strcat WordS "       "
  1230.    fwrite 0 TempS I8
  1231.    fputc 0 10
  1232. SkipLib:
  1233.    strcmp Order3 "UPL"
  1234.    if success
  1235.       sdlginput "FILE TYPE DEFINITION" "Enter Type of file (ASC,BIN):" TempS
  1236.       strupr TempS
  1237.       strcat WordS TempS
  1238.       strcmp TempS "BIN"
  1239.       if success
  1240.          strcat WordS "        "
  1241.       else
  1242.          strcat WordS "      "
  1243.       endif
  1244.       strlen TempS I8
  1245.       fwrite 0 TempS I8
  1246.       fputc 0 10
  1247.    else
  1248.       strcat WordS "              "
  1249.    endif
  1250.    sdlginput "FILENAME DEFINITION" "Enter Filename including extension:" TempS
  1251.    strupr TempS
  1252.    strcat WordS TempS
  1253.    strcat WordS "      "
  1254.    strlen TempS I8
  1255.    fwrite 0 TempS I8
  1256.    fputc 0 10
  1257.    strcmp Order3 "UPL"
  1258.    if success
  1259.       strcmp Order1 "GO CIS:MAIL"
  1260.       if success
  1261.          goto DefineFin
  1262.       endif
  1263. ; provide for ASCII send of Description
  1264.       usermsg "Provide Description - not to exceed 6 2/3 lines"
  1265. DescAgain:
  1266.       strcmpi $WINMODE "STANDARD"      ; not needed in Enhanced mode
  1267.       if success
  1268.          I7=$CONNECTION
  1269.          inc I7
  1270.          set connection port none
  1271.       endif
  1272.       Name=Cfg7                        ; this is editor path\filename
  1273.       strcat Name " "
  1274.       Char=Cfg9                        ; this is files directory
  1275.       strcat Char "\"
  1276.       strcat Char "DESCRIPT.TMP"
  1277.       strcat Name Char
  1278.       run Name MAXIMIZED
  1279.       strcmpi $WINMODE "STANDARD"      ; reset for Standard mode
  1280.       if success
  1281.          set connection port I7
  1282.       endif
  1283.       fopen 1 Char READ TEXT
  1284.       I7=0
  1285.       for I6=1 upto 7
  1286.          TempS=$NULLSTR
  1287.          fgets 1 TempS
  1288.          strcmp TempS $NULLSTR
  1289.          if success
  1290.             exitfor
  1291.          endif
  1292.          strlen TempS I8
  1293.          fwrite 0 TempS I8
  1294.          add I7 I8 I7
  1295.          inc I7
  1296.          fputc 0 10
  1297.       endfor
  1298.       fwrite 0 "/EXIT" 5
  1299.       fputc 0 10
  1300.       fclose 1
  1301.       sub I7 538 I7
  1302.       if I7 > 0
  1303.          BEEP
  1304.          add I7 48 I7
  1305.          usermsg "Description is over length by %c characters." I7
  1306.          goto DescAgain
  1307.       endif
  1308.       delfile Char                     ; deletes temporary file
  1309. ; input and store Keywords
  1310. DefineFin:
  1311.       TempS=$NULLSTR
  1312. KeyAgain:
  1313.       strcmp Order1 "GO CIS:MAIL"
  1314.       if success
  1315.          sdlginput "ADDRESSEE OF FILE" "Enter Addressee and user ID :" TempS DEFAULT
  1316.       else
  1317.          sdlginput "KEYWORDS FOR UPLOAD" "Enter Keywords for Upload (80 character maximum) :" TempS DEFAULT
  1318.       endif
  1319.       strlen TempS I8
  1320.       sub I8 80 I7
  1321.       if I7 > 0
  1322.          BEEP
  1323.          add I7 48 I7
  1324.          usermsg "Keywords is over length by %c characters." I7
  1325.          goto KeyAgain
  1326.       endif
  1327.       fwrite 0 TempS I8
  1328.       fputc 0 10
  1329. ; input and store Title
  1330.       TempS=$NULLSTR
  1331. TitleAgain:
  1332.       strcmp Order1 "GO CIS:MAIL"
  1333.       if success
  1334.          sdlginput "SUBJECT OF FILE" "Enter Subject for CIS use :" TempS DEFAULT
  1335.       else
  1336.          sdlginput "TITLE FOR UPLOAD" "Enter Title of Upload (47 character maximum) :" TempS DEFAULT
  1337.       endif
  1338.       strlen TempS I8
  1339.       sub I8 47 I7
  1340.       if I7 > 0
  1341.          BEEP
  1342.          add I7 48 I7
  1343.          usermsg "Title is over length by %c characters." I7
  1344.          goto TitleAgain
  1345.       endif
  1346.       strlen TempS I8
  1347.       fwrite 0 TempS I8
  1348.       fputc 0 10
  1349.    endif
  1350.    strcmp File1 $NULLSTR
  1351.    if success
  1352.       File1=WordS
  1353.       goto DefineEnd
  1354.    endif
  1355.    strcmp File2 $NULLSTR
  1356.    if success
  1357.       File2=WordS
  1358.       goto DefineEnd
  1359.    endif
  1360.    strcmp File3 $NULLSTR
  1361.    if success
  1362.       File3=WordS
  1363.       goto DefineEnd
  1364.    endif
  1365.    strcmp File4 $NULLSTR
  1366.    if success
  1367.       File4=WordS
  1368.       goto DefineEnd
  1369.    endif
  1370.    strcmp File5 $NULLSTR
  1371.    if success
  1372.       File5=WordS
  1373.       goto DefineEnd
  1374.    endif
  1375.    strcmp File6 $NULLSTR
  1376.    if success
  1377.       File6=WordS
  1378.       goto DefineEnd
  1379.    endif
  1380.    strcmp File7 $NULLSTR
  1381.    if success
  1382.       File7=WordS
  1383.       goto DefineEnd
  1384.    endif
  1385.    strcmp File8 $NULLSTR
  1386.    if success
  1387.       File8=WordS
  1388.       goto DefineEnd
  1389.    endif
  1390.    strcmp File9 $NULLSTR
  1391.    if success
  1392.       File9=WordS
  1393.       goto DefineEnd
  1394.    endif
  1395.    strcmp File10 $NULLSTR
  1396.    if success
  1397.       File10=WordS
  1398.       goto DefineEnd
  1399.    endif
  1400. DefineEnd:
  1401. ENDPROC ;DefineFile
  1402.  
  1403. ;  ---------------------------------------------------
  1404. ; |    PROCEDURES  FOR  DEFINING  MULTIPLE  TASKS     |
  1405. ;  ---------------------------------------------------
  1406.  
  1407. PROC Multi
  1408.    if eq Tour 1
  1409.       Locn1=Order
  1410.       substr Area1 Order1 3 10
  1411.       strlwr Area1
  1412.       Sect1=Order2
  1413.       strlwr Sect1
  1414.       Actn1=Order3
  1415.       strlwr Actn1
  1416.       ShoTask1=Order3
  1417.       Extn1=Order4
  1418.       strcat ShoTask1 Order4
  1419.       strlwr ShoTask1
  1420.    endif
  1421.    if eq Tour 2
  1422.       I1=1
  1423.       Locn2=Order
  1424.       substr Area2 Order1 3 10
  1425.       strlwr Area2
  1426.       Sect2=Order2
  1427.       strlwr Sect2
  1428.       Actn2=Order3
  1429.       strlwr Actn2
  1430.       ShoTask2=Order3
  1431.       Extn2=Order4
  1432.       strcat ShoTask2 Order4
  1433.       strlwr ShoTask2
  1434.    endif
  1435.    if eq Tour 3
  1436.       I1=1
  1437.       I2=1
  1438.       Locn3=Order
  1439.       substr Area3 Order1 3 10
  1440.       strlwr Area3
  1441.       Sect3=Order2
  1442.       strlwr Sect3
  1443.       Actn3=Order3
  1444.       strlwr Actn3
  1445.       ShoTask3=Order3
  1446.       Extn3=Order4
  1447.       strcat ShoTask3 Order4
  1448.       strlwr ShoTask3
  1449.    endif
  1450.    if eq Tour 4
  1451.       I1=1
  1452.       I2=1
  1453.       I3=1
  1454.       Locn4=Order
  1455.       substr Area4 Order1 3 10
  1456.       strlwr Area4
  1457.       Sect4=Order2
  1458.       strlwr Sect4
  1459.       Actn4=Order3
  1460.       strlwr Actn4
  1461.       ShoTask4=Order3
  1462.       Extn4=Order4
  1463.       strcat ShoTask4 Order4
  1464.       strlwr ShoTask4
  1465.    endif
  1466.    if eq Tour 5
  1467.       I1=1
  1468.       I2=1
  1469.       I3=1
  1470.       I4=1
  1471.       Locn5=Order
  1472.       substr Area5 Order1 3 10
  1473.       strlwr Area5
  1474.       Sect5=Order2
  1475.       strlwr Sect5
  1476.       Actn5=Order3
  1477.       strlwr Actn5
  1478.       ShoTask5=Order3
  1479.       Extn5=Order4
  1480.       strcat ShoTask5 Order4
  1481.       strlwr ShoTask5
  1482.    endif
  1483.    Call MultiBox
  1484.    choice=$DIALOG
  1485.    while choice != 1
  1486.       choice=$DIALOG
  1487.       switch choice
  1488.          case 10
  1489.             Call ClearTask
  1490.             Call MultiBox
  1491.          endcase
  1492.          case 11
  1493.             GoAhead=1
  1494.             I0=0
  1495.             exitwhile
  1496.          endcase
  1497.          case 12
  1498.             Call ClearTask
  1499.             GoAhead=0
  1500.             I0=0
  1501.             exitwhile
  1502.          endcase
  1503.          case 70
  1504.             if eq I1 1
  1505.                if eq Tour 0
  1506.                   Tour=1
  1507.                   GoAhead=0
  1508.                   exitwhile
  1509.                endif
  1510.             endif
  1511.          endcase
  1512.          case 71
  1513.             if eq I2 1
  1514.                if eq Tour 1
  1515.                   Tour=2
  1516.                   GoAhead=0
  1517.                   exitwhile
  1518.                endif
  1519.             endif
  1520.          endcase
  1521.          case 72
  1522.             if eq I3 1
  1523.                if eq Tour 2
  1524.                   Tour=3
  1525.                   GoAhead=0
  1526.                   exitwhile
  1527.                endif
  1528.             endif
  1529.          endcase
  1530.          case 73
  1531.             if eq I4 1
  1532.                if eq Tour 3
  1533.                   Tour=4
  1534.                   GoAhead=0
  1535.                   exitwhile
  1536.                endif
  1537.             endif
  1538.          endcase
  1539.          case 74
  1540.             if eq I5 1
  1541.                if eq Tour 4
  1542.                   Tour=5
  1543.                   GoAhead=0
  1544.                   exitwhile
  1545.                endif
  1546.             endif
  1547.          endcase
  1548.       endswitch
  1549.    endwhile
  1550.    destroydlg
  1551.    TourMax = Tour                      ; TourMax is total number of Tasks
  1552. ENDPROC ;Multi
  1553.  
  1554. PROC MultiBox
  1555.    dialogbox 75 90 205 110 6 "MULTIPLE TASK DEFINITION"
  1556.       text 10 10 190 70 left "DEFINE TASKS:"
  1557.       checkbox 15 22 35 10 "Task 1" I1
  1558.       checkbox 15 34 35 10 "Task 2" I2
  1559.       checkbox 15 46 35 10 "Task 3" I3
  1560.       checkbox 15 58 35 10 "Task 4" I4
  1561.       checkbox 15 70 35 10 "Task 5" I5
  1562.       pushbutton 10 88 55 15 "Clear Tasks" normal
  1563.       pushbutton 75 88 55 15 "Proceed" normal
  1564.       pushbutton 140 88 55 15 "Cancel" normal
  1565.       vtext 55 24 33 9 left Area1
  1566.       vtext 55 36 33 9 left Area2
  1567.       vtext 55 48 33 9 left Area3
  1568.       vtext 55 60 33 9 left Area4
  1569.       vtext 55 72 33 9 left Area5
  1570.       vtext 90 24 35 9 left Sect1
  1571.       vtext 90 36 35 9 left Sect2
  1572.       vtext 90 48 35 9 left Sect3
  1573.       vtext 90 60 35 9 left Sect4
  1574.       vtext 90 72 35 9 left Sect5
  1575.       vtext 130 24 70 9 left ShoTask1             ; Actn + Extn
  1576.       vtext 130 36 70 9 left ShoTask2
  1577.       vtext 130 48 70 9 left ShoTask3
  1578.       vtext 130 60 70 9 left ShoTask4
  1579.       vtext 130 72 70 9 left ShoTask5
  1580.    enddialog
  1581. ENDPROC ;MultiBox
  1582.  
  1583. PROC ClearTask
  1584.    Tour=0
  1585.    I1=0
  1586.    I2=0
  1587.    I3=0
  1588.    I4=0
  1589.    I5=0
  1590.    Area1=$NULLSTR
  1591.    Area2=$NULLSTR
  1592.    Area3=$NULLSTR
  1593.    Area4=$NULLSTR
  1594.    Area5=$NULLSTR
  1595.    Sect1=$NULLSTR
  1596.    Sect2=$NULLSTR
  1597.    Sect3=$NULLSTR
  1598.    Sect4=$NULLSTR
  1599.    Sect5=$NULLSTR
  1600.    Actn1=$NULLSTR
  1601.    Actn2=$NULLSTR
  1602.    Actn3=$NULLSTR
  1603.    Actn4=$NULLSTR
  1604.    Actn5=$NULLSTR
  1605.    Extn1=$NULLSTR
  1606.    Extn2=$NULLSTR
  1607.    Extn3=$NULLSTR
  1608.    Extn4=$NULLSTR
  1609.    Extn5=$NULLSTR
  1610.    ShoTask1=$NULLSTR
  1611.    ShoTask2=$NULLSTR
  1612.    ShoTask3=$NULLSTR
  1613.    ShoTask4=$NULLSTR
  1614.    ShoTask5=$NULLSTR
  1615. ENDPROC ;ClearTask
  1616.  
  1617. ;  -------------------------------------------------
  1618. ; |    PROCEDURES  FOR  DEFINING  CONFIGURATION     |
  1619. ;  -------------------------------------------------
  1620.  
  1621. PROC PerConfig
  1622.    dialogbox 115 70 130 155 2 "PERSONAL INFORMATION"
  1623.       pushbutton 6 5 57 15 "Access phone" update
  1624.       pushbutton 6 25 57 15 "User ID number" update
  1625.       pushbutton 6 45 57 15 "CIS Password" update
  1626.       pushbutton 6 65 57 15 "Baud rate" update
  1627.       pushbutton 6 85 57 15 "MNP message" update
  1628.       pushbutton 6 105 57 15 "Name for Forum" update
  1629.       pushbutton 35 130 60 15 "Finished" normal default
  1630.       vtext 66 8 60 12 left Cfg1
  1631.       vtext 66 28 60 12 left Cfg2
  1632.       vtext 66 48 60 12 left Cfg0
  1633.       vtext 66 68 60 12 left Cfg4
  1634.       vtext 66 88 60 12 left Cfg5
  1635.       vtext 66 108 60 12 left Cfg6
  1636.    enddialog
  1637.    choice=$DIALOG
  1638.    while choice != 1
  1639.       choice=$DIALOG
  1640.       switch choice
  1641.          case 10
  1642.             exitwhile
  1643.          endcase
  1644.          case 30
  1645.             sdlginput "Phone Request" "Input CIS access number:" Cfg1 DEFAULT
  1646.             updatedlg 64
  1647.          endcase
  1648.          case 31
  1649.             sdlginput "User ID Request" "Input your User ID number:" Cfg2 DEFAULT
  1650.             updatedlg 64
  1651.          endcase
  1652.          case 32
  1653.             sdlginput "Password Request" "Input your password:" Cfg3 DEFAULT
  1654.             updatedlg 64
  1655.          endcase
  1656.          case 33
  1657.             sdlginput "Baud Rate Request" "Input Baud rate:" Cfg4 DEFAULT
  1658.             updatedlg 64
  1659.          endcase
  1660.          case 34
  1661.             sdlginput "MNP response Request" "Input MNP message:" Cfg5 DEFAULT
  1662.             updatedlg 64
  1663.          endcase
  1664.          case 35
  1665.             sdlginput "Name for Forum Request" "Input name to use in Forum:" Cfg6 DEFAULT
  1666.             updatedlg 64
  1667.          endcase
  1668.       endswitch
  1669.    endwhile
  1670. ENDPROC ;PerConfig
  1671.  
  1672. PROC DirConfig
  1673.    dialogbox 80 70 200 115 2 "DIRECTORY INFORMATION"
  1674.       pushbutton 6 5 57 15 "Editor Filename" update
  1675.       pushbutton 6 25 57 15 "Mail Directory" update
  1676.       pushbutton 6 45 57 15 "File Directory" update
  1677.       pushbutton 6 65 57 15 "Log Directory" update
  1678.       pushbutton 70 90 60 15 "Finished" normal default
  1679.       vtext 66 8 130 12 left Cfg7
  1680.       vtext 66 28 130 12 left Cfg8
  1681.       vtext 66 48 130 12 left Cfg9
  1682.       vtext 66 68 130 12 left Cfg10
  1683.    enddialog
  1684.    choice=$DIALOG
  1685.    while choice != 1
  1686.       choice=$DIALOG
  1687.       switch choice
  1688.          case 10
  1689.             exitwhile
  1690.          endcase
  1691.          case 30
  1692.             sdlginput "Editor Filename Request" "Input complete Path:" Cfg7 DEFAULT
  1693.             updatedlg 64
  1694.          endcase
  1695.          case 31
  1696.             sdlginput "Mail Directory Request" "Input complete Path:" Cfg8 DEFAULT
  1697.             updatedlg 64
  1698.          endcase
  1699.          case 32
  1700.             sdlginput "File Directory Request" "Input complete Path:" Cfg9 DEFAULT
  1701.             updatedlg 64
  1702.          endcase
  1703.          case 33
  1704.             sdlginput "Capture log Directory Request" "Input complete Path:" Cfg10 DEFAULT
  1705.             updatedlg 64
  1706.          endcase
  1707.       endswitch
  1708.    endwhile
  1709. ENDPROC ;DirConfig
  1710.  
  1711. PROC OptConfig
  1712.    dialogbox 130 70 100 125 2 "OPTION INFORMATION"
  1713.       checkbox 15 5 80 12 "Show Program Info" Cfg11
  1714.       checkbox 15 20 80 12 "Delete Mail" Cfg12
  1715.       checkbox 15 35 80 12 "Confirm Dialing" Cfg13
  1716.       checkbox 15 50 80 12 "Command mode" Cfg14
  1717.       checkbox 15 65 80 12 "Confirm Mail Pickup" Cfg15
  1718.       checkbox 15 80 80 12 "Suspend Dialing" Cfg16
  1719.       pushbutton 20 100 60 15 "Finished" normal default
  1720.    enddialog
  1721.    choice=$DIALOG
  1722.    while choice != 1
  1723.       choice=$DIALOG
  1724.       switch choice
  1725.          case 10
  1726.             exitwhile
  1727.          endcase
  1728.       endswitch
  1729.    endwhile
  1730. ENDPROC ;OptConfig
  1731.  
  1732. PROC ReadCfg
  1733.     fopen 0 "AUTOCIS.CFG" READ         ; opens configuration file for read only
  1734.     for I7=1 UPTO 16
  1735.        fgets 0 Name
  1736.        strlen Name I6
  1737.        dec I6
  1738.        dec I6
  1739.        switch I7
  1740.           case 1
  1741.              SUBSTR Cfg1 Name 0 I6
  1742.           endcase
  1743.           case 2
  1744.              SUBSTR Cfg2 Name 0 I6
  1745.           endcase
  1746.           case 3
  1747.              SUBSTR Cfg3 Name 0 I6
  1748.           endcase
  1749.           case 4
  1750.              SUBSTR Cfg4 Name 0 I6
  1751.           endcase
  1752.           case 5
  1753.              SUBSTR Cfg5 Name 0 I6
  1754.           endcase
  1755.           case 6
  1756.              SUBSTR Cfg6 Name 0 I6
  1757.           endcase
  1758.           case 7
  1759.              SUBSTR Cfg7 Name 0 I6
  1760.           endcase
  1761.           case 8
  1762.              SUBSTR Cfg8 Name 0 I6
  1763.           endcase
  1764.           case 9
  1765.              SUBSTR Cfg9 Name 0 I6
  1766.           endcase
  1767.           case 10
  1768.              SUBSTR Cfg10 Name 0 I6
  1769.           endcase
  1770.           case 11
  1771.              SUBSTR TempS Name 0 I6
  1772.              ATOI TempS Cfg11
  1773.           endcase
  1774.           case 12
  1775.              SUBSTR TempS Name 0 I6
  1776.              ATOI TempS Cfg12
  1777.           endcase
  1778.           case 13
  1779.              SUBSTR TempS Name 0 I6
  1780.              ATOI TempS Cfg13
  1781.           endcase
  1782.           case 14
  1783.              SUBSTR TempS Name 0 I6
  1784.              ATOI TempS Cfg14
  1785.           endcase
  1786.           case 15
  1787.              SUBSTR TempS Name 0 I6
  1788.              ATOI TempS Cfg15
  1789.           endcase
  1790.           case 16
  1791.              SUBSTR TempS Name 0 I6
  1792.              ATOI TempS Cfg16
  1793.           endcase
  1794.        endswitch
  1795.     endfor
  1796.     fclose 0
  1797. ENDPROC ;ReadCfg
  1798.  
  1799. PROC SaveCfg
  1800.     isfile "AUTOCIS.CFG"
  1801.     if success
  1802.        fopen 0 "AUTOCIS.CFG" WRITE
  1803.     else
  1804.        fopen 0 "AUTOCIS.CFG" CREATE
  1805.     endif
  1806.     strlen Cfg1 I8
  1807.     fwrite 0 Cfg1 I8
  1808.     fputc 0 13
  1809.     fputc 0 10
  1810.     strlen Cfg2 I8
  1811.     fwrite 0 Cfg2 I8
  1812.     fputc 0 13
  1813.     fputc 0 10
  1814.     strlen Cfg3 I8
  1815.     fwrite 0 Cfg3 I8
  1816.     fputc 0 13
  1817.     fputc 0 10
  1818.     strlen Cfg4 I8
  1819.     fwrite 0 Cfg4 I8
  1820.     fputc 0 13
  1821.     fputc 0 10
  1822.     strlen Cfg5 I8
  1823.     fwrite 0 Cfg5 I8
  1824.     fputc 0 13
  1825.     fputc 0 10
  1826.     strlen Cfg6 I8
  1827.     fwrite 0 Cfg6 I8
  1828.     fputc 0 13
  1829.     fputc 0 10
  1830.     strlen Cfg7 I8
  1831.     fwrite 0 Cfg7 I8
  1832.     fputc 0 13
  1833.     fputc 0 10
  1834.     strlen Cfg8 I8
  1835.     fwrite 0 Cfg8 I8
  1836.     fputc 0 13
  1837.     fputc 0 10
  1838.     strlen Cfg9 I8
  1839.     fwrite 0 Cfg9 I8
  1840.     fputc 0 13
  1841.     fputc 0 10
  1842.     strlen Cfg10 I8
  1843.     fwrite 0 Cfg10 I8
  1844.     fputc 0 13
  1845.     fputc 0 10
  1846.     ITOA Cfg11 TempS
  1847.     fwrite 0 TempS 1
  1848.     fputc 0 13
  1849.     fputc 0 10
  1850.     ITOA Cfg12 TempS
  1851.     fwrite 0 TempS 1
  1852.     fputc 0 13
  1853.     fputc 0 10
  1854.     ITOA Cfg13 TempS
  1855.     fwrite 0 TempS 1
  1856.     fputc 0 13
  1857.     fputc 0 10
  1858.     ITOA Cfg14 TempS
  1859.     fwrite 0 TempS 1
  1860.     fputc 0 13
  1861.     fputc 0 10
  1862.     ITOA Cfg15 TempS
  1863.     fwrite 0 TempS 1
  1864.     fputc 0 13
  1865.     fputc 0 10
  1866.     ITOA Cfg16 TempS
  1867.     fwrite 0 TempS 1
  1868.     fputc 0 13
  1869.     fputc 0 10
  1870.     fclose 0
  1871. ENDPROC ;SaveCfg
  1872.  
  1873. PROC ProgInfo
  1874.    dialogbox 110 70 140 125 2 "PROGRAM INFORMATION"
  1875.       text  10 8 120 8 center "Procomm for Windows V1.xx script"
  1876.       text  15 25 110 8 center "A U T O C I S"
  1877.       text  15 32 110 4 center "~~~~~~~~~~"
  1878.       text  15 38 110 8 center "Version 1.00"
  1879.       text  15 54 110 8 center "Released 5 November 1992"
  1880.       text  15 64 110 8 center "Written by Ralph Deitrick"
  1881.       text  15 74 110 8 center "CompuServe UID 76547,3434"
  1882.       text  15 88 110 8 center "PLEASE read AUTOCIS.DOC"
  1883.       pushbutton 50 102 40 15 "OK" normal default
  1884.    enddialog
  1885.    choice=$DIALOG
  1886.    while choice != 1
  1887.       choice=$DIALOG
  1888.       if eq choice 10
  1889.          exitwhile
  1890.       endif
  1891.    endwhile
  1892. ENDPROC ;ProgInfo
  1893.  
  1894. ;  ------------------------------------------
  1895. ; |    PROCEDURES  FOR  INVOKING  EDITOR     |
  1896. ;  ------------------------------------------
  1897.  
  1898. PROC DoEdit
  1899.    Call ShoDirBox
  1900.    while choice != 1
  1901.       choice=$DIALOG
  1902.       switch choice
  1903.          case 10
  1904.             Name=Cfg7
  1905.             strcat Name " "
  1906.             strcat Name UseFile
  1907.             run Name MAXIMIZED
  1908.             Call ShoDirBox
  1909.          endcase
  1910.          case 11
  1911.             TempS=UseFile
  1912.             sdlginput "RENAME INPUT REQUEST" "Input new Path\filename:" TempS DEFAULT
  1913.             rename UseFile TempS
  1914.             Call ShoDirBox
  1915.          endcase
  1916.          case 12
  1917.             TempS="Are you sure you want to delete "
  1918.             strcat TempS UseFile
  1919.             strcat TempS " ?"
  1920.             sdlgmsgbox "DELETION CONFIRMATION" TempS STOP YESNO I7
  1921.             if eq I7 6
  1922.                delfile UseFile
  1923.                if not success
  1924.                   errormsg "Can't delete %s !" UseFile
  1925.                endif
  1926.             elseif eq I7 7
  1927.                usermsg "File deletion canceled !"
  1928.             endif
  1929.             Call ShoDirBox
  1930.          endcase
  1931.          case 13
  1932.             TempS=Usefile
  1933.             sdlginput "COPY FILE DESTINATION" "Input new Path\filename:" TempS DEFAULT
  1934.             strcmp TempS UseFile
  1935.             if success
  1936.                errormsg "File can not be copied unto itself !"
  1937.             else
  1938.                copyfile UseFile TempS
  1939.                if not success
  1940.                   errormsg "File copy not successful !"
  1941.                endif
  1942.             endif
  1943.             Call ShoDirBox
  1944.          endcase
  1945.          case 14
  1946.             sdlginput "DIRECTORY REQUEST" "Input COMPLETE Directory Path:" DirName DEFAULT
  1947.             Call ShoDirBox
  1948.          endcase
  1949.          case 15
  1950.             exitwhile
  1951.          endcase
  1952.       endswitch
  1953.    endwhile
  1954. ENDPROC ;DoEdit
  1955.  
  1956. PROC ShoDirBox
  1957.    dialogbox 115 50 130 130 2 "DOCUMENT REVIEWER"
  1958.       dirlistbox 68 16 56 110 DirName single UseFile
  1959.       vtext 5 4 123 9 left DirName
  1960.       pushbutton 7 16 50 14 "Write/Edit" normal default
  1961.       pushbutton 7 34 50 14 "Rename File" normal
  1962.       pushbutton 7 52 50 14 "Delete File" normal
  1963.       pushbutton 7 70 50 14 "Copy File" normal
  1964.       pushbutton 7 88 50 14 "Change Dir" normal
  1965.       pushbutton 7 106 50 14 "Finished" normal
  1966.    enddialog
  1967. ENDPROC ;ShoDirBox
  1968.  
  1969. ; ****************************************************************************
  1970. ; *                                                                          *
  1971. ; *                OPERATIONS  ON  LINE  WITH  COMPUSERVE                    *
  1972. ; *                                                                          *
  1973. ; ****************************************************************************
  1974.  
  1975. ;  ----------------------------------------------------------
  1976. ; |    PROCEDURES  FOR  MAIL  OPERATIONS  ON  COMPUSERVE     |
  1977. ;  ----------------------------------------------------------
  1978. PROC MailRun                           ; need to catch "no mail waiting"
  1979.     if Tour >= 2
  1980.        strcmp TempS Order1
  1981.        if success
  1982.           pause 1
  1983.           goto DoMail
  1984.        endif
  1985.     endif
  1986.     waitfor "Mail  Main" 20
  1987.     waitfor "no mail" 1                ; choice will occur during this waitfor
  1988.     if success
  1989.        MailWait=0                      ; indicates no mail waiting  (No)
  1990.     else
  1991.        MailWait=1                      ; indicates there is mail waiting (Yes)
  1992.    endif
  1993.    waitfor "choice !" 1                ; likely occurs while waitfor "no mail"
  1994.    count=0
  1995.    if eq Cfg14 1                       ; this indicates command mode
  1996.       S0="Mail!"                       ; top menu
  1997.       S2="Action!"                     ; action menu
  1998.       S3="Send!"                       ; Send menu
  1999.       transmit "SET MOD COM^M"
  2000.    else
  2001.       S0="Main Menu"
  2002.       S2="<CR>"
  2003.       S3="Send Menu"                   ; Send menu
  2004.       transmit "SET MOD MEN^M"
  2005.    endif
  2006.    waitfor "choice !" 3                ; wait for end of Menu
  2007. DoMail:
  2008.    substr TempS Order3 0 6
  2009.    switch TempS
  2010.       case "Send T"
  2011.          Call SendText
  2012.       endcase
  2013.       case "Send F"
  2014.          Call FileSend
  2015.       endcase
  2016.       case "Get Ma"
  2017.          if eq MailWait 1
  2018.             Call GetMail
  2019.          else
  2020.             MailRecd=0
  2021.          endif
  2022.       endcase
  2023.    endswitch
  2024. ENDPROC ;MailRun
  2025.  
  2026. PROC SendText                          ; sends ASCII Mail files
  2027.    transmit "SET EDI NOL^M"
  2028.    WAITFOR "choice !" 3
  2029.    when Target 1 S2 Call TransCR        ; this is press <CR>
  2030.    when Target 2 S0 Call ClrFlag        ; this is Mail! & sets Flag=0
  2031.    Flag=1
  2032.    Name =  MailDir
  2033.    strcat Name "\LETTERS.OUT"
  2034.    SendFile ASCII Name
  2035.    while flag                          ; waiting for Mail! prompt
  2036.    endwhile
  2037.    fopen 0 Name READWRITE TEXT
  2038.    while not FEOF 0
  2039.       fgets 0 Char
  2040.       strcmp Char "/SEND" 5
  2041.       if success
  2042.          inc Count
  2043.       endif
  2044.    endwhile
  2045.    TempS = "           *****  SENT @ "
  2046.    strcat TempS $time
  2047.    strcat TempS " on "
  2048.    strcat TempS $date
  2049.    strcat TempS "  *****"
  2050.    fwrite 0 TempS 54
  2051.    fclose 0
  2052.    clearwhen Target 1
  2053.    clearwhen Target 2
  2054.    add MailSent Count MailSent
  2055. ENDPROC ;SendText
  2056.  
  2057. PROC FileSend                          ; uploads Binary mail files
  2058.     DesFile=FileDir
  2059.     STRCAT DesFile "\FileUPL.MAI"
  2060.     FOPEN 0 DesFile READ TEXT
  2061. StartBin:
  2062.     Call GetParam
  2063.     WordS=TempS                        ; save type of file, ASC or BIN
  2064.     strcmp TempS "END" 3
  2065.     if success
  2066.        goto EndBinMail
  2067.     endif
  2068.     transmit "UPL/PRO:B/TYP:"
  2069.     transmit TempS                     ; this is ASC or BIN
  2070.     transmit "^M"
  2071.     waitfor "computer:" 10
  2072.     Name=MailDir
  2073.     strcat Name "\"
  2074.     Call GetParam
  2075.     strcat Name TempS
  2076.     transmit Name
  2077.     transmit "^M"
  2078.     waitfor "" 5                      ; wait for enquiry
  2079.     pause 1
  2080.     set terminal enquiry CISB
  2081.     Call DoTransfer
  2082.     set terminal enquiry OFF
  2083.     if eq Item 3
  2084.        goto EndBinMail
  2085.     endif
  2086.     strcmp WordS "BIN"                 ; this was saved above
  2087.     if success
  2088.        Call GetParam
  2089.        transmit TempS                  ; this is addressee of BIN file
  2090.        transmit "^M"
  2091.        waitfor "Subject:" 5
  2092.        Call GetParam
  2093.        transmit TempS                  ; this is subject of BIN file
  2094.        transmit "^M"
  2095.     endif
  2096.     waitfor "(Y or N)" 3
  2097.     pause 1
  2098.     transmit "Y^M"                     ; confirms addressee and subject
  2099.     if eq KeepOn 1
  2100.        goto StartBin                   ; return to send next file
  2101.     endif
  2102. EndBinMail:
  2103.     ADD MailSent count MailSent        ; Count is limited to 9 maximum
  2104. ENDPROC ;FileSend
  2105.  
  2106. PROC GetMail
  2107.    transmit "SET PAG NO^M"             ; set paging off
  2108.    waitfor "choice !"                  ; wait for end of Menu
  2109.    Count=0
  2110.    BinCnt=0
  2111.    Item=0
  2112.    clearwhen Target 0
  2113.    when Target 0 "age is B" Call GetBin        ; this is "Message is Binary"
  2114.    when target 1 S0 Call Terminate             ; this is "Mail!"
  2115.    when Target 2 S2 Call MailDispose           ; this is Action! or press <CR>
  2116.    transmit "REA ALL"                          ; request read all mail
  2117.    Flag=1
  2118.    transmit "^M"
  2119.    while Flag
  2120.    endwhile
  2121.    clearwhen Target 0
  2122.    clearwhen Target 1
  2123.    clearwhen Target 2
  2124.    when Target 0 "% Invalid" CALL GoManual   ; protection against "bad" commands
  2125.    add MailRecd count MailRecd                 ; total of mail received
  2126. ENDPROC ;GetMail
  2127.  
  2128. PROC GetBin
  2129.    clearwhen Target 2
  2130.    Call MailDL
  2131.    Call MailDispose
  2132.    when Target 2 S2 Call MailDispose           ; this is Action! or press <CR>
  2133. ENDPROC ;GetBin
  2134.  
  2135. PROC MailDispose
  2136.    pause 1
  2137.    if eq Cfg14 0                       ; this indicates menu mode
  2138.       transmit "^M"                    ; answer to press <CR>
  2139.       mspause 500                      ; wait for action menu
  2140.    endif
  2141.    switch Cfg12
  2142.       case 0                           ; means don't delete mail
  2143.          transmit "SAV"
  2144.       endcase
  2145.       case 1                           ; means delete mail after retrieval
  2146.          if eq Item 3                  ; this is download failure
  2147.             Item=0
  2148.             transmit "SAV"
  2149.          else
  2150.             transmit "DEL"
  2151.          endif
  2152.       endcase
  2153.    endswitch
  2154.    inc Count                           ; account for another letter received
  2155.    transmit "^M"                       ; deletes or saves mail
  2156. ENDPROC ;MailDispose
  2157.  
  2158. PROC MailDL
  2159.    INC BinCnt
  2160.    Name="BINLTR"
  2161.    ITOA BinCnt Char
  2162.    strcat Name Char
  2163.    set autodnld ON
  2164.    set terminal enquiry CISB           ; set for automatic cisb download
  2165.    Flag=1
  2166.    I6=0
  2167.    transmit "DOW/PRO:B^M"              ; download with CompuServe B Protocol
  2168. ; try to recover Binary filename
  2169.    while Flag                          ; loop checking for filename
  2170.       rget TempS 60                    ; get 60 characters of received data
  2171.       if eq I6 0                      ; provides check until filename found
  2172.          strfind TempS "." I7         ; period between filename & extension
  2173.          if found
  2174.             sub I7 8 I8              ; allow for 8 character filename
  2175.             dec I7                    ; move to left of decimal
  2176.             for I6=I7 downto I8     ; check backward for 8 characters
  2177.                strpeek TempS I6 I9
  2178.                if ge I9 48           ; this is zero
  2179.                   if le I9 57        ; this is 9
  2180.                      loopfor           ; continues if character is a number
  2181.                   endif
  2182.                endif
  2183.                if le I9 64           ; stops for space, slash, colon, etc.
  2184.                   sub I7 I6 I7       ; number of characters in filename
  2185.                   add I7 4 I7        ; add for decimal and extension
  2186.                   Inc I6              ; move right to first letter
  2187.                   substr Name TempS I6 I7      ; get filename plus extension
  2188.                   exitwhile            ; go to download once filename is found
  2189.                endif
  2190.             endfor
  2191.             I6=1                      ; eliminates this check once filename
  2192.          endif                         ;        is found
  2193.       endif
  2194.       strfind TempS "ter:"             ; "your computer:"  prompt
  2195.       if found
  2196.          goto DoDL                     ; loop exit once prompt appears
  2197.       endif
  2198.    endwhile
  2199.    waitfor "computer:"
  2200. ; perform the actual download
  2201. DoDL:
  2202.     transmit MailDir
  2203.     transmit "\"
  2204.     transmit Name
  2205.     transmit "^M"
  2206.    Call DoTransfer
  2207.    if eq Item 2
  2208.       dec Count
  2209.    endif
  2210.    set autodnld OFF
  2211.    set terminal enquiry OFF            ; turn off enquiry response
  2212. ENDPROC ;MailDL
  2213.  
  2214. ;  -----------------------------------------------------------
  2215. ; |    PROCEDURES  FOR  FORUM  OPERATIONS  ON  COMPUSERVE     |
  2216. ;  -----------------------------------------------------------
  2217.  
  2218. PROC ForumRun
  2219.     when target 1 "waiting" Call GetWaiting
  2220.     Count=0
  2221.     if Tour >= 2
  2222.        strcmp TempS Order1
  2223.        if success
  2224.           clearwhen Target 1          ; no need for "waiting" if still in Forum
  2225.           goto DoTask
  2226.        endif
  2227.     endif
  2228.     if eq Cfg13 1
  2229.        S1="Messages !"
  2230.        S2="Forum !"
  2231.        S3="ages !"
  2232.        S4=" !"
  2233.     else
  2234.        S1="choice !"
  2235.        S2="choice !"
  2236.        S3="choice !"
  2237.        S4=" !"
  2238.     endif
  2239. ; check for messages waiting upon entering Forum
  2240.     waitfor "Welcome" 60               ; entrance to Forum - may take a long
  2241.     waitfor "<CR> !" 15                ;           time if SysOp messages
  2242.                                        ; if waiting, read will occur here
  2243.     if eq Cfg13 1                      ; this means command mode
  2244.        transmit "OPT;MOD COM;PAU NEV;S^M"  ; sent to ans "Press <CR> !"
  2245.     else
  2246.        transmit "OPT;MOD MEN;PAU NEV;S^M"  ; sent to ans "Press <CR> !"
  2247.     endif
  2248.     waitfor S2 5                       ; signifies end of Forum Menu
  2249.     clearwhen Target 1                 ; no need for "waiting" prompt any more
  2250. ; now check to see if joining the Forum is desired
  2251.     strlen Order1 I8
  2252.     sub I8 7 I6
  2253.     substr WordS Order1 7 I6          ; WordS is Area name (i.e. DSTORM)
  2254.     strcmp Join WordS                  ; is joining necessary ?
  2255.     if success                         ; yes, joining is desired
  2256.        transmit "Join"                 ; indicate selection is JOIN
  2257.        waitfor "Name:" 5
  2258.         transmit Cfg9                  ; send your name
  2259.         transmit "^M"
  2260.        waitfor "correct" 2
  2261.         transmit "Y^M"                 ; confirm correctness
  2262.         pause 2
  2263.         transmit "^M"
  2264.        waitfor S2 5                    ; signifies end of Forum Menu
  2265.        Join=""                         ; clear the join request
  2266.     endif
  2267. ; now perform desired task
  2268. DoTask:
  2269.     substr TempS Order2 0 3
  2270.     switch TempS
  2271.        case "mes"
  2272.           transmit "MES^M"             ; go to Message Menu
  2273.           waitfor S3 5
  2274.           substr TempS Order3 0 3
  2275.           switch TempS
  2276.              case "DEL"
  2277.                 transmit Order3
  2278.                 transmit Order4
  2279.                 transmit "^M"
  2280.                 waitfor "N)?"
  2281.                 transmit "Y^M"
  2282.              endcase
  2283.              case "REA"
  2284.                 Count=0
  2285.                 when target 2 "#: " Call ChgCount
  2286.                 pause 1
  2287.                 transmit Order3             ; this is REA ???
  2288.                 strcmp Order4 $NULLSTR
  2289.                 if not success
  2290.                    transmit Order4          ; this is message number
  2291.                 endif
  2292.                 Char=S3
  2293.                 Call CheckEnd               ; includes TRANSMIT "^M"
  2294.                 clearwhen Target 2
  2295.                 add MesgRecd Count MesgRecd
  2296.                 goto ForRunOut
  2297.              endcase
  2298.              case "ROO"
  2299.                 transmit "OPT;PAU ALW;S^M"  ; indicate to pause after message
  2300.                 waitfor S2 5
  2301.                 transmit "REA NUM:"         ; read message
  2302.                 transmit Order4             ; number for which to find root
  2303.                 transmit "^M"
  2304.                 waitfor "Action" 20
  2305.                 transmit "ROO^M"
  2306.                 waitfor "#: " 10            ; wait for start of Root message number
  2307.                 rget TempS 6                ; get Root message number - 6 digits
  2308.                 waitfor "Action" 20
  2309.                 transmit "B^M"              ; return to Read Menu
  2310.                 waitfor S1 20               ; waiting for end of Read Menu
  2311.                 transmit "OPT;PAU NEV;S^M"
  2312.                 waitfor S1 20               ; waiting for end of Read Menu
  2313.                 Count=0
  2314.                 when target 2 "#: " CALL ChgCount
  2315.                 transmit "REA THR NUM:"
  2316.                 transmit TempS              ; this is Root message of thread
  2317.                 Char=S3
  2318.                 Call CheckEnd               ; includes TRANSMIT "^M"
  2319.                 clearwhen Target 2
  2320.                 add MesgRecd Count MesgRecd
  2321.                 goto ForRunOut
  2322.              endcase
  2323.              case "Sen"
  2324.                 Count=0
  2325.                 transmit "OPT;EDI EDI;S^M"
  2326.                 waitfor S1 15               ; at end of Messages menu
  2327.                 TempS=LogDir
  2328.                 strcat TempS "\MESSAGES."
  2329.                 substr Char Order1 7 3
  2330.                 strcat TempS Char
  2331.                 pause 1
  2332.                 sendfile ASCII TempS
  2333.                 while $TXCOUNT
  2334.                 endwhile
  2335.                 waitfor S1
  2336.                 fopen 0 TempS READWRITE TEXT
  2337.                 while not feof 0
  2338.                    fgets 0 Char
  2339.                    strcmp Char "/POST" 5
  2340.                    if success
  2341.                       Call ChgCount
  2342.                    endif
  2343.                 endwhile
  2344.                 fwrite 0 "          **********  SENT  **********" 38
  2345.                 fclose 0
  2346.                 add MesgSent Count MesgSent
  2347.                 goto ForRunOut
  2348.              endcase
  2349.           endswitch
  2350.        endcase
  2351.        case "lib"
  2352.           transmit "SET PAG NO;LIB 1^M"
  2353. ; determine title of Lib 1
  2354.           comgets WordS 40 2
  2355.           strlen WordS I8
  2356.           sub I8 10 I7
  2357.           substr SaveS WordS I7 8
  2358.           substr TempS Order3 0 3
  2359.           switch TempS
  2360.              case "DOW"
  2361.                 Call DnLoad
  2362.                 goto ForRunOut         ;     and leave CompuServe
  2363.              endcase
  2364.              case "UPL"
  2365.                 Call UpLoad
  2366.                 goto ForRunOut         ;     and leave CompuServe
  2367.              endcase
  2368.              case "BRO"
  2369.                 transmit Order3
  2370.                 transmit Order4        ; Lib numbers to cover
  2371.                 transmit "^M"
  2372.                 Order3="Manual mode"
  2373.                 Call ExitWait
  2374.                 goto ForRunOut         ;     and leave CompuServe
  2375.              endcase
  2376.              case "Man"
  2377.                 Call ExitWait
  2378.                 goto ForRunOut
  2379.              endcase
  2380.              default
  2381.                 transmit "SET PAGE OFF^M"
  2382.                 waitfor S4 5           ; this is " !"
  2383.                 transmit Order3        ; defines how many days to go back
  2384.                 transmit Order4        ; Lib numbers to cover & keywords
  2385.                 Char = SaveS           ; SaveS defined at entrance to Lib 1
  2386.                 Call CheckEnd          ; includes TRANSMIT "^M"
  2387.                 goto ForRunOut         ;     and leave CompuServe
  2388.              endcase
  2389.           endswitch
  2390.        endcase
  2391.     endswitch
  2392. ForRunOut:
  2393. ENDPROC ;ForumRun
  2394.  
  2395. PROC GetWaiting
  2396.     when target 2 "#: " Call ChgCount
  2397.     if eq Cfg13 1
  2398.        transmit "OPT;MOD COM;S^M"      ; this is sent in ans to "Press <CR> !"
  2399.     else
  2400.        transmit "OPT;MOD MEN;S^M"      ; this is sent in ans to "Press <CR> !"
  2401.     endif
  2402.     waitfor S2 2                       ; signifies return from Options
  2403.     transmit "MES;REA WAIT;S"          ; returns to Messages Menu
  2404.     Char=S3                            ; signifies end of Messages Menu
  2405.     Call CheckEnd                      ; includes TRANSMIT "^M"
  2406.     transmit "B^M"                     ; back up to Forum Menu
  2407.     waitfor S2                         ; signifies end of Forum Menu
  2408.     clearwhen Target 1
  2409.     clearwhen Target 2
  2410.     add MesgRecd Count MesgRecd
  2411. ENDPROC ;GetWaiting
  2412.  
  2413. PROC ChgCount
  2414.    inc Count
  2415. ENDPROC ;ChgCount
  2416.  
  2417. ;  --------------------------------------------------------------
  2418. ; |    PROCEDURES  FOR  ZIFF Net  OPERATIONS  ON  COMPUSERVE     |
  2419. ;  --------------------------------------------------------------
  2420.  
  2421. PROC SoftRun
  2422.     Count=0
  2423.     waitfor "Library" 60               ; may take long time entering Ziff Net
  2424.     strcmp Order2 "4"                  ; this is download a utility
  2425.     if success
  2426.        DesFile=FileDir
  2427.        strcat DesFile "\FileDOW.SOF"
  2428.        fopen 0 DesFile READ TEXT
  2429.        Call GetParam                   ; get filename if it's a download
  2430.     endif
  2431. DoSoftGo:
  2432.     waitfor "choice !" 3
  2433.     transmit Order2
  2434.     transmit "^M"
  2435.     strcmp Order4 "Manual mode"
  2436.     if success
  2437.        Call ExitWait
  2438.        goto DoSoftOut
  2439.     endif
  2440.     switch Order2
  2441.        case "3"                        ; search
  2442.           waitfor ":" 1
  2443.           transmit Order3              ; this is type of search
  2444.           transmit "^M"
  2445.           WAITFOR "choice" 1
  2446.           when target 1 "more !" Call TransCR
  2447.           when target 2 "Last page" CALL ClrFlag    ; sets Flag to zero
  2448.           Flag=1
  2449.           transmit Order4              ; this is keyword, file name, etc.
  2450.           transmit "^M"
  2451.           while Flag
  2452.           endwhile
  2453.           clearwhen target 1
  2454.           clearwhen target 2
  2455.        endcase
  2456.        case "4"                        ; download file(s)
  2457.           waitfor ") :" 10
  2458.           transmit TempS
  2459.           transmit "^M"
  2460.           waitfor "(Y/N):" 10
  2461.           transmit "Y^M"
  2462.           waitfor "minutes" 3
  2463.           transmit "^M"
  2464.           waitfor "choice !" 3
  2465.           transmit "2^M"
  2466.           MSPAUSE 500
  2467.           GETFILE CISB
  2468.           waitfor "page !" 15
  2469.           inc Count
  2470.           Call GetParam
  2471.           strcmp TempS "END" 3         ; check for end of data
  2472.           if not success
  2473.              transmit Order1           ; this returns to initial menu
  2474.              transmit "^M"
  2475.              GOTO DoSoftGo
  2476.           endif
  2477.           fclose 0
  2478.           add FileRecd Count FileRecd
  2479.        endcase
  2480.        default                         ; about library & instructions
  2481.           when target 1 "more !" Call TransCR
  2482.           when target 2 "Last page !" Call ClrFlag
  2483.           Flag=1
  2484.           while Flag
  2485.           endwhile
  2486.           clearwhen Target 1
  2487.           clearwhen Target 2
  2488.        endcase
  2489.     endswitch
  2490. DoSoftOut:
  2491. ENDPROC  ;SoftRun
  2492.  
  2493. ;  ------------------------------------
  2494. ; |    FILE  TRANSFER   PROCEDURES     |
  2495. ;  ------------------------------------
  2496.  
  2497. PROC DnLoad
  2498.    Count=0                             ; S4=" !" has occurred
  2499.    DesFile=FileDir
  2500.    strcat DesFile "\FileDOW."
  2501.    substr TempS Order1 7 3             ; get first 3 letters of Forum name
  2502.    strcat DesFile TempS
  2503.    fopen 0 DesFile READ TEXT
  2504. StartDL:
  2505.    WordS = "LIB "
  2506.    Call GetParam
  2507.    strcmp TempS "END" 3                ; check for end of data
  2508.    if success
  2509.       goto EndDL
  2510.    endif
  2511.    strcat WordS TempS                  ; WordS now is "LIB #"
  2512.    transmit WordS                      ; indicate which Lib to go to
  2513.    transmit "^M"
  2514.    waitfor " !" 5                      ; have to wait for next menu
  2515.    transmit "DOW PRO:B "
  2516.    Call GetParam
  2517.    strcmp TempS "END" 3                ; check for end of data
  2518.    if success
  2519.       goto EndDL
  2520.    endif
  2521.    Name = TempS
  2522.    transmit Name
  2523.    transmit "^M"
  2524. ; see if file exists
  2525.    waitfor "Not found" 5
  2526.    if success
  2527.       goto StartDL
  2528.    else
  2529. ; perform the actual download          ; next prompt would be "computer:"
  2530.       set autodnld ON
  2531.       set terminal enquiry CISB        ; set for automatic cisb download
  2532.       transmit FileDir                 ; download directory
  2533.       transmit "\"
  2534.       transmit Name                    ; use same filename as source
  2535.       transmit "^M"                    ; send it
  2536.       Call DoTransfer
  2537.       set autodnld OFF
  2538.       set terminal enquiry OFF         ; set for automatic download off
  2539.    endif
  2540.    waitfor " !" 3
  2541.    goto StartDL
  2542. EndDL:
  2543.    add FileRecd Count FileRecd
  2544. ENDPROC ;DnLoad
  2545.  
  2546. PROC UpLoad
  2547.    Count = 0
  2548.    DesFile=FileDir
  2549.    strcat DesFile "\FileUPL."
  2550.    substr TempS Order1 7 3             ; get first 3 letters of Forum name
  2551.    strcat DesFile TempS
  2552.    fopen 0 DesFile READ TEXT
  2553. StartUL:
  2554.    pause 1
  2555.    WordS = "LIB "
  2556.    Call GetParam                       ; returns data in TempS
  2557.    strcmp TempS "END" 3                ; check for end of data
  2558.    if success
  2559.       goto EndUL
  2560.    endif
  2561.    strcat WordS TempS                  ; WordS now is "LIB #"
  2562.    transmit WordS                      ; indicate which Lib to go to
  2563.    transmit "^M"
  2564.    waitfor "!" 15
  2565.    Call GetParam
  2566.    strcmp TempS "END"                  ; check for end of data
  2567.    if success
  2568.       goto EndUL
  2569.    endif
  2570.    transmit "UPL PRO:B TYPE:"          ; request Upload using CIS B+ protocol
  2571.    transmit TempS                      ; this is ASC, BIN, etc
  2572.    transmit "^M"
  2573.    waitfor "name:" 15
  2574.    Call GetParam
  2575.    Name=TempS                          ; this is filename
  2576.    transmit Name                       ; send filename for CIS
  2577.    transmit "^M"                       ; finalize UPL or Protocol command
  2578. DoUL:
  2579.    waitfor "computer:" 5
  2580.    set terminal enquiry CISB           ; set for automatic upload on
  2581.    if success
  2582.       clearwhen Target 0               ; to avoid "%" about file already exists
  2583.       transmit FileDir                 ; send directory for your computer
  2584.       transmit "\"
  2585.       transmit Name                    ; send filename for your computer
  2586.       transmit "^M"
  2587.    else                                ; in case "Replace it" is prompt
  2588.       transmit "Y^M"                   ; indicate replacement is desired
  2589.       goto DoUL
  2590.    endif
  2591.    waitfor "" 5
  2592.    while $FILEXFER == 0
  2593.    endwhile
  2594.    Call DoTransfer
  2595.    set terminal enquiry OFF
  2596.    if eq Item 3
  2597.       goto FinUL
  2598.    endif
  2599.    waitfor "Description" 10
  2600.    while 1
  2601.       for I6 = 1 upto 8
  2602.          Call GetParam
  2603.          transmit TempS
  2604.          strcmp TempS "/EXIT" 5
  2605.          if success
  2606.             exitwhile
  2607.          else
  2608.             transmit "^M"
  2609.          endif
  2610.       endfor
  2611.    endwhile
  2612.    transmit "^M"
  2613.    waitfor "Keywords" 10
  2614.    pause 2
  2615.    while 1
  2616.       Call GetParam
  2617.       strcmp TempS "OK"
  2618.       if not success                   ; if original or replacement
  2619.          transmit TempS
  2620.       endif
  2621.       transmit "^M"                    ; sends keyword or says none needed
  2622.       exitwhile
  2623.    endwhile
  2624.    waitfor "Title" 10
  2625.    pause 2
  2626.    while 1
  2627.       Call GetParam
  2628.       strcmp TempS "OK"
  2629.       if not success                      ; if original or replacement
  2630.          transmit TempS
  2631.       endif
  2632.       transmit "^M"                       ; sends title or says none needed
  2633.       exitwhile
  2634.    endwhile
  2635.    waitfor "(Y or N)?" 10
  2636.     transmit "Y^M"                     ; indicates correct
  2637.    waitfor "Press <CR>" 3
  2638.     transmit "^M"
  2639.     pause 1
  2640. FinUL:
  2641.     when Target 0 "% Invalid" CALL GoManual   ; reactivate non MNP safeguard
  2642.     if eq KeepOn 1                     ; if multiple files
  2643.        goto StartUL                    ; return to send next file
  2644.     endif
  2645. EndUL:
  2646.     fclose 0
  2647.     add FileSent Count FileSent
  2648. ENDPROC ;UpLoad
  2649.  
  2650. PROC GetParam
  2651.     FGETS 0 Char
  2652.     STRLEN Char I8
  2653.     SUBSTR TempS Char 0 I8
  2654. ENDPROC ;GetParam
  2655.  
  2656. PROC DoTransfer
  2657.    Item=$FILEXFER
  2658.    while Item < 2
  2659.       Item=$FILEXFER
  2660.    endwhile
  2661.    pause 2
  2662.    switch Item
  2663.       case 2
  2664.          inc Count
  2665.       endcase
  2666.       case 3
  2667.          dialogbox 200 70 120 18 14 "FILE TRANSFER STATUS"
  2668.           text 10 4 100 10 center "FILE TRANSFER FAILURE !"
  2669.          enddialog
  2670.          alarm 1                       ; alarm for failed download
  2671.          pause 2
  2672.          destroydlg
  2673.       endcase
  2674.    endswitch
  2675. ENDPROC ;DoTransfer
  2676.  
  2677. PROC TransCR
  2678.    transmit "^M"
  2679. ENDPROC ;TransCR
  2680.  
  2681. ;  ----------------------------------------------
  2682. ; |    PROCEDURES  FOR  ENTERING  COMPUSERVE     |
  2683. ;  ----------------------------------------------
  2684.  
  2685. PROC LogOn
  2686.    Long Rate                           ; define Rate as Long number
  2687.    while $TXCOUNT                      ; characters remaining to transmit
  2688.    endwhile
  2689.    Call DefineLog                      ; define capture log name
  2690.    set capture path Cfg10
  2691.    set capture file LogName
  2692.    set capture mode append FILTERED
  2693.    set capture query off               ; DO NOT prompt for filename
  2694.    if $FROMDDIR
  2695.       Call StartLog                    ; write header in capture log
  2696.       capture ON                       ; open file LogName
  2697.       goto AfterDial
  2698.    endif
  2699.    set terminal type 5
  2700.    set terminal stripbit8 ON           ; strip the eighth bit
  2701.    set protocol CISB
  2702.    set port parity NONE
  2703.    set port databits 8
  2704.    set port stopbits 1
  2705.    set port duplex FULL
  2706.    set port dropdtr YES
  2707. ; convert Baud rate string to long number
  2708.    strlen Cfg4 I8
  2709.    sub I8 2 I8
  2710.    strcpy TempS Cfg4 I8
  2711.    ATOI TempS I6
  2712.    Rate=I6
  2713.    mul Rate 100 Rate
  2714.    set baudrate Rate                   ; Configure line settings
  2715.    if eq Cfg16 1                       ; request for delayed dialing
  2716.       Call Delay
  2717.       if Flag
  2718.          goto End
  2719.       endif
  2720.    endif
  2721.    I6=5                               ; number of redial attempts
  2722. Retry:
  2723.    time S8                             ; Store current time in S8
  2724.    date S9                             ; Store current date in S9
  2725.    strfmt TempS " Dialing CompuServe at %s on %s from terminal" S8 S9
  2726.    pwtitlebar TempS
  2727.    Call StartLog                       ; write header in capture log
  2728. ; dial the number
  2729.    txflush
  2730.    pause 1
  2731.    Flag=0
  2732.    when target 1 "NO CARRIER" call SetFlag    ; sets Flag = 1
  2733.    transmit "ATDT "                    ; dial the number
  2734.    transmit Cfg1
  2735.    transmit "^M^J"                     ; carriage return and line feed
  2736.    while $DIALING
  2737.    endwhile
  2738.    pause 8                             ; needed to wait for answer
  2739.    if eq Flag 1
  2740.       goto badlogon
  2741.    endif
  2742.    capture ON                          ; open file LogName
  2743. ; confirm Reliable connection
  2744.    strcmp Cfg5 $NULLSTR                ; if no error conformation expected
  2745.    if success                          ;(non error-correcting modem or no Cfg5)
  2746.       while ! $CARRIER
  2747.       endwhile
  2748.       alarm 2                          ; sound when carrier achieved
  2749.       goto AfterDial
  2750.    else
  2751.       when target 1 Cfg5 call SetFlag    ; sets Flag = 1
  2752.       when target 2 "NONE" call ChgFlag  ; sets Flag = 2
  2753.       Flag=0
  2754.       Count=0
  2755.       while not flag
  2756.          pause 1
  2757.          inc Count
  2758.          if eq Count 35
  2759.             Flag=2                     ; means time out
  2760.             exitwhile
  2761.          endif
  2762.       endwhile
  2763.       clearwhen Target 1
  2764.       clearwhen Target 2
  2765.       if eq Flag 2                     ; means either time out or no Protocol
  2766.          goto badlogon
  2767.       endif
  2768.       alarm 2                          ; indicate successful connection
  2769.    endif
  2770. AfterDial:                             ; come here from dialing directory
  2771.    if $CARRIER
  2772.       KeepOn = 1
  2773.    else
  2774.       goto badlogon
  2775.    endif
  2776. ; script for logging onto CIS
  2777.    while $CARRIER
  2778.       transmit "^M"                    ; initiate logging on CIS
  2779.       waitfor "Host Name:"
  2780.       if success
  2781.          transmit "CIS^M"
  2782.       else
  2783.          goto badlogon
  2784.       endif
  2785.       waitfor "User ID:"
  2786.       if success
  2787.          transmit Cfg2
  2788.          transmit "^M"
  2789.       else
  2790.          goto badlogon
  2791.       endif
  2792.       waitfor "Password:"
  2793.       if success
  2794.          transmit Cfg3                 ; send password, transmit "^M" is below
  2795.       else
  2796.          goto badlogon
  2797.       endif
  2798.       L1=$ltime                     ; Start time for lapsed time calculation
  2799.       set terminal stripbit8 OFF       ; stop striping the eighth bit
  2800.       when Target 0 "% Invalid" CALL GoManual   ; protection against "bad" commands
  2801.       when cdchanges CALL LostCD
  2802.       when Target 2 "Mail wait" CALL PickUpMail ; to catch mail waiting message
  2803.       transmit "^M"                    ; Send <CR> for Password transmission
  2804.       waitfor "Reserved" 60            ; end of CompuServe banner
  2805.       pwtitlebar "On line to CompuServe"
  2806.       waitfor "Enter choice"  10       ; choice request at end of Top Menu
  2807.                                        ; mail pickup will occur here ----
  2808.       clearwhen Target 2               ; no more chance for mail message-close
  2809.       goto End
  2810.    endwhile
  2811.  
  2812. BadLogon:
  2813.    hangup
  2814.    capture OFF
  2815.    KeepOn = 0
  2816.    while I6 > 0                       ; for count variable positive,
  2817.       dec I6                          ;          decrement the counter and
  2818.       pwtitlebar "Pausing before redialing"
  2819.       pause 15                         ; wait 10 seconds before redial before
  2820.       goto Retry                       ;       going back to redial
  2821.    endwhile
  2822.    set terminal stripbit8 OFF          ; stop striping the eighth bit
  2823.    pwtitlebar CISTitle
  2824.    UserMsg "Log on aborted"
  2825. End:
  2826. ENDPROC ;LogOn
  2827.  
  2828. PROC ClrFlag
  2829.    Flag=0
  2830. ENDPROC ;ClrFlag
  2831.  
  2832. PROC SetFlag
  2833.    Flag=1
  2834. ENDPROC  ;SetFlag
  2835.  
  2836. PROC ChgFlag
  2837.    Flag=2
  2838. ENDPROC  ;ChgFlag
  2839.  
  2840. PROC DefineLog
  2841.    Date Today
  2842.    SubStr Month Today 0 2
  2843.    SubStr Day Today 3 2
  2844.    LogName="CIS_"
  2845.    StrCat LogName Month 2
  2846.    StrCat logName Day 2
  2847.    StrCat LogName ".CAP" 4
  2848. ENDPROC ;DefineLog
  2849.  
  2850. PROC StartLog
  2851.    LogLoc=LogDir
  2852.    strcat LogLoc "\"
  2853.    strcat LogLoc LogName
  2854.    IsFile LogLoc
  2855.    If Success
  2856.        FOpen 1 LogLoc WRITE TEXT       ; open Capture Log for appending
  2857.        FSeek 1 0 2
  2858.    Else
  2859.        FOpen 1 LogLoc CREATE TEXT      ; open Capture Log for first write
  2860.    EndIf
  2861.    Fputc 1 10                          ; sends line feed to file
  2862.    TempS=">>>> CISPlus Capture Log Opened on "
  2863.    StrCat TempS $Date
  2864.    StrCat TempS " at "
  2865.    StrCat TempS $Time
  2866.    StrCat TempS " <<<<"
  2867.    fputs 1 TempS
  2868.    FClose 1                            ; close Capture Log after heading write
  2869. ENDPROC ;StartLog
  2870.  
  2871. PROC Delay
  2872.    sdlginput "SUSPEND TIME DEFINITION" "Enter military time in HH:MM format:" TempS
  2873.    strfmt WordS "DIALING WILL BEGIN AT %s" TempS
  2874.    dialogbox 115 90 130 45 14 "SUSPENDED DIALING"
  2875.     vtext 10 4 110 8 center WordS
  2876.     pushbutton 10 20 50 15 "Immediate" normal default
  2877.     pushbutton 70 20 50 15 "Cancel" normal
  2878.    enddialog
  2879.    Flag = 1
  2880.    while Flag
  2881.       S1=$TIME24                       ; continually get current Military time
  2882.       strcmp S1 TempS 5                ; compare current HH:MM to suspend time
  2883.       if success                       ; when they are the same
  2884.          Flag = 0                      ;               exit the WHILE
  2885.          exitwhile
  2886.       endif
  2887.       choice=$DIALOG
  2888.       switch choice
  2889.          case 10
  2890.             Flag = 0                   ;               exit the WHILE
  2891.             exitwhile
  2892.          endcase
  2893.          case 11
  2894.             exitwhile                  ; leaves Flag = 1
  2895.          endcase
  2896.       endswitch
  2897.    endwhile
  2898.    destroydlg
  2899. ENDPROC ;Delay
  2900.  
  2901. PROC PickUpMail
  2902.     clearwhen Target 2                 ; close WHEN before "Mail" occurs again
  2903.     strcmp Order1 "GO CIS:MAIL"
  2904.     if success
  2905.        strcmp Order3 "Get Mail"
  2906.        if success
  2907.           goto PickUpEnd
  2908.        endif
  2909.     endif
  2910.     if eq Cfg15 1                      ; indicates confirm mail pickup
  2911.        sdlgmsgbox "AUTOMATIC MAIL PICKUP" "MAIL WAITING !,Download Mail Now ?" \
  2912.           QUESTION YESNO choice BEEP
  2913.        if eq choice 7                  ; this is No (6 is Yes)
  2914.           goto PickUpEnd
  2915.        endif
  2916.     endif
  2917.     SaveS=Order3
  2918.     Order3="Get Mail"
  2919.     transmit "GO CIS:MAIL^M"
  2920.     Call MailRun
  2921.     Order3=SaveS
  2922.     SaveS=$NULLSTR
  2923. PickUpEnd:
  2924. ENDPROC ;PickUpMail
  2925.  
  2926. ;  ---------------------------------------------
  2927. ; |    PROCEDURES  FOR  LEAVING  COMPUSERVE     |
  2928. ;  ---------------------------------------------
  2929.  
  2930. PROC CheckEnd                          ; suggested by Markus Pope of DATASTORM
  2931.    Flag=1
  2932.    when TARGET 1 Char  CALL Terminate  ; WHEN 2 is counting messages
  2933.  
  2934.    transmit "^M"
  2935.    while Flag
  2936.       if eq KeepOn 0
  2937.          exitwhile
  2938.       endif
  2939.    endwhile
  2940.    clearwhen Target 1
  2941. ENDPROC ;CheckEnd
  2942.  
  2943. PROC Terminate
  2944.    Flag=0
  2945. ENDPROC ;Terminate
  2946.  
  2947. PROC LostCD
  2948.    dialogbox 250 150 70 18 14 "CD INTERRUPT"
  2949.     text 10 4 50 8 center "Carrier lost"
  2950.    enddialog
  2951.    for I6=1 upto 5
  2952.       if $CARRIER
  2953.          goto LostCDOut
  2954.       endif
  2955.       mspause 500
  2956.    endfor
  2957.    KeepOn = 0
  2958.    Call ExitCIS
  2959. LostCDOut:
  2960.    destroydlg
  2961. ENDPROC ;LostCD
  2962.  
  2963. PROC GoManual
  2964.    sdlgmsgbox "INVALID COMMAND PROBLEM" "Enter Commands Manually" EXCLAMATION OK choice
  2965.    CALL ExitWait                       ; wait for LOG command
  2966. ENDPROC ;GoManual
  2967.  
  2968. PROC LogOff
  2969.    waitfor "!" 2
  2970.    transmit "LOG^M"
  2971.    Call ExitWait
  2972. ENDPROC ;LogOff
  2973.  
  2974. PROC ExitWait
  2975.    waitfor "User ID:" FOREVER
  2976.    Call ExitCIS
  2977. ENDPROC ;ExitWait
  2978.  
  2979. PROC ExitCIS
  2980.    clearwhen Target 0
  2981.    clearwhen Target 1
  2982.    clearwhen Target 2
  2983.    clearwhen cdchanges                 ; discontinue check for disconnect
  2984.    pause 1                             ;       wait for completion of hang up
  2985.    if $CARRIER
  2986.       hangup                           ;    then hang up the modem
  2987.    endif
  2988.    pause 1                             ;       wait for completion of hang up
  2989.    Capture OFF                         ;         and close the log
  2990.    KeepOn = 0
  2991.    Call Lapsed
  2992.    FOpen 1 LogLoc WRITE TEXT           ; open Capture Log for appending
  2993.    FSeek 1 0 2                         ; locate end of file
  2994.    FStrFmt 1 "%cTotal CompuServe connect time was %s%c*****%c" 10 ETime 10 10
  2995.    FClose 1
  2996. ENDPROC ;ExitCIS
  2997.  
  2998. PROC Lapsed
  2999.    Long Final
  3000.    Integer Delta, eminsub, ehours, eminutes, eseconds
  3001.    String fhours, fminutes, fseconds
  3002.    Final = $ltime                      ; Here starts the loop which calculates
  3003.    Delta = Final - L1               ; total elapsed seconds
  3004.    div Delta 3600 ehours               ; convert on-line time back
  3005.    mod Delta 3600 eminsub              ; to hrs. min. secs.
  3006.    div eminsub 60 eminutes             ; (Divide total by 3600 for
  3007.    mod eminsub 60 eseconds             ; hours; get REMAINDER;
  3008.    itoa ehours fhours                  ; divide remainder by 60
  3009.    itoa eminutes fminutes              ; to get minutes, etc.)
  3010.    itoa eseconds fseconds              ; Integers back to strings
  3011.    strfmt ETime " %s:%02s:%02s " fhours fminutes fseconds ; Final display param
  3012. ENDPROC ;Lapsed
  3013. ; ========================  END  OF  SCRIPT  ===========================
  3014.  
  3015.